Last active
July 24, 2020 01:40
-
-
Save csarron/6d259b75479c20a0b5d3c95a4728f747 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 0. clone/fork repo, | |
# 1. add remote upstream | |
git remote add upstream https://github.com/xx/xx.git | |
# 2. checkout work branch | |
git checkout -b work | |
# If you are trying to "checkout" a new remote branch (that exists only on the remote, but not locally) | |
git fetch origin | |
git checkout --track origin/<remote_branch_name> | |
while not done: | |
# do the work, and commit to the work branch | |
# 3. sync with upstream | |
git pull --rebase # need to git branch --set-upstream-to=upstream/master work | |
# or below two steps | |
git fetch upstream | |
git rebase upstream/master | |
# 4. push to the remote work branch (should be ready to send pull request) | |
# if the pull request is merged, better checkout a new branch from the upstream/master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment