Main Repository Your group's repository.
Fork Your fork of your group's repository.
- Clone your fork to your computer.
git clone 'your fork address'
- Add the main repository as upstream.
git remote add upstream 'your main repo address'
-
Every work you do must address an open issue.
-
Pull from upstream into your local repo's master.
git checkout master
git pull upstream master
- Create a branch from master and checkout to that branch.
git checkout -b your-branch-name
- Do your work. committing frequently with proper commit messages.
yes | sudo apt install sl && sl # Only if you're on Linux
- Pull from upstream into your branch and resolve merge conflicts if necessary.
git checkout your-branch-name
git fetch upstream master
git merge upstream/master
- Push your local branch to your fork.
git push origin your-branch-name
-
Go to GitHub. Locate your branch in your fork and create a pull request from it to the main repository master.
-
Label your pull request appropriately.
-
Add reviewers and wait for their review. Meanwhile, your code will be automatically tested for errors.
-
If your pull request is approved and passes the automated tests, squash and merge. Write proper messages.
-
Else, don't close your pull request. Instead, simply repeat steps 4 to 6.
If you are comfortable with the basic workflow, you can do the following things:
-
In step 5, you can rebase instead of merging.
-
In step 10, you can merge without squashing.