11

How to update a forked repo with git rebase – Git

 3 years ago
source link: http://chintanrathod.com/update-forked-repo-git-rebase-git/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

How to update a forked repo with git rebase – Git

Many times you might came across to update/sync your forked repository with main repo. There are multiple ways but below one is very efficient way to sync your forked repo with main repo.

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
Views: 15
000000

Tags git github rebase repository version control


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK