Skip to content

Instantly share code, notes, and snippets.

@Rushi98
Last active August 26, 2017 19:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Rushi98/336862b4a23f315b38b84fbd0184f54f to your computer and use it in GitHub Desktop.
Save Rushi98/336862b4a23f315b38b84fbd0184f54f to your computer and use it in GitHub Desktop.
  1. Don't make changes to master branch.

  2. When you see a new issue you can solve, add a comment on it to the issue. Let's say the issue number is N.

  3. 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
  1. Do your thing. Commit.

  2. 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.

  1. 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
  1. If you see any conflicts, resolve them.

  2. Now do git log to ensure that your branch is just one commit ahead of upstream/master.

  3. Do git diff master inspect your patch.

git push origin fix-issue-N
  1. In github, start a pull request. If there are any suggestions, repeat from 6.

  2. 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment