Skip to content

Instantly share code, notes, and snippets.

@tataue
Last active October 7, 2021 13:53
Show Gist options
  • Save tataue/b25a8bdb67f4bd09f4002879da22709d to your computer and use it in GitHub Desktop.
Save tataue/b25a8bdb67f4bd09f4002879da22709d to your computer and use it in GitHub Desktop.
[github flow] #git #gitflow

同步 forcked repo

最新功能 How to update a forked repo with git rebase merge origin remote feature:

Step 1: Add the remote (original repo that you forked) and call it “upstream”

git remote add upstream https://github.com/original-repo/goes-here.git

Step 2: Fetch all branches of remote upstream

git fetch upstream

Step 3: Rewrite your master with upstream’s master using git rebase.

git rebase upstream/master

Step 4: Push your updates to master. You may need to force the push with “--force”.

  git push origin master --force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment