-
Don't make changes to
master
branch. -
When you see a new issue you can solve, add a comment
on it
to the issue. Let's say the issue number isN
. -
Do
git checkout master
git fetch upstream
git merge upstream/master
or if you failed at 0
git reset --hard upstream/master
git checkout -b fix-issue-N
-
Do your thing. Commit.
-
Assuming you've done
M
commits for this patch. Do
git rebase -i HEAD~M
In the next file that opens, replace all pick
words except first one by squash
. Save the file.
In the next file, write a commit message for your pr. (Following the PR format). Save the file.
- If above step is successful, do
git checkout master
git fetch upstream
git merge upstream/master
git checkout fix-issue-N
git rebase -i master
-
If you see any conflicts, resolve them.
-
Now do
git log
to ensure that your branch is just one commit ahead ofupstream/master
. -
Do
git diff master
inspect your patch.
git push origin fix-issue-N
-
In github, start a pull request. If there are any suggestions, repeat from 6.
-
When your pr is accepted
git checkout master
git branch -D fix-issue-N # deletes the fix-issue-N branch
git push -d fix-issue-N # deletes the fix-issue-N branch at origin
Drink a coffee!