Skip to content

Instantly share code, notes, and snippets.

@2KAbhishek
Last active June 7, 2020 03:24
Show Gist options
  • Save 2KAbhishek/dec2e3b21e684e7c891a753402463e31 to your computer and use it in GitHub Desktop.
Save 2KAbhishek/dec2e3b21e684e7c891a753402463e31 to your computer and use it in GitHub Desktop.
Sync forked repo with upstream after merge

Clone your fork and cd into it

git clone https://github.com/yourname/repo.git
cd yourname/repo

Add upstream remote

git remote add upstream https://github.com/original-author/repo.git
git fetch upstream

Pull Changes from upstream and push to fork

git pull upstream master
git push origin master

Ignore all changes in fork and sync with upstream

git reset --hard upstream/master
git push -f origin master
@2KAbhishek
Copy link
Author

I am using master as the example branch name here.

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