To work on our repository, we want to ensure that we have a structured workflow where we don't overwrite people's changes on accident or cause trouble with the main branch of the GitHub repository.
To do this, we are going to be using forks of GitHub repositories and pull requests. Here's a step-by-step guide on how to set up a structured workflow to prevent accidental overwrites and troubles with the main branch using forks and pull requests:
Fork the Main Repository
Go to the main repository.
Click the "Fork" button in the upper right corner. This will create a copy of the repository under your GitHub account.
Clone your fork
Go to your forked repository on GitHub.
Click the "Code" button and copy the repository URL.
Open your terminal and use the git clone command to clone your fork to your local machine.
Create a New Branch
Before making any changes, create a new branch for your work. This keeps your changes isolated from the main branch
Make Changes on the Branch
Push Changes to your fork on GitHub
Create a Pull Request
Go to your forked repository on GitHub.
Click on the "Pull Requests" tab.
Click the "New Pull Request" button.
Select the base repository (the main repository) and the base branch (typically "main" or "master").
Select your forked repository and branch in the "compare" section.
Write a clear and concise description of your changes.
Click "Create Pull Request."
Review and Collaborate
Others will review pull request and may request changes or approve it.
You can continue to make changes to your branch, and they will automatically be added to the pull request.
Merge Pull Requests
Once your pull request is approved, it can be merged into the main branch of the main repository.
Keep Your Fork Updated:
Periodically, it's a good practice to fetch and merge changes from the main repository into your fork to keep it up to date.
This workflow ensures that changes are proposed and reviewed before merging into the main branch, reducing the risk of accidental overwrites and conflicts. It also allows for collaborative development while keeping the main branch stable.
To work on our repository, we want to ensure that we have a structured workflow where we don't overwrite people's changes on accident or cause trouble with the main branch of the GitHub repository.
To do this, we are going to be using forks of GitHub repositories and pull requests. Here's a step-by-step guide on how to set up a structured workflow to prevent accidental overwrites and troubles with the main branch using forks and pull requests:
git clone
command to clone your fork to your local machine.
This workflow ensures that changes are proposed and reviewed before merging into the main branch, reducing the risk of accidental overwrites and conflicts. It also allows for collaborative development while keeping the main branch stable.
┆Issue is synchronized with this Trello card by Unito