Reputation: 255
I forked from repoA, then others merged their PR into repoA, how do I sync repoA and my forkedOfRepoA?
Is it automatically sync?
I visit forkedOfRepoA I saw a message:
This branch is 37 commits behind repoA:master`
What I should do next?
Upvotes: 0
Views: 44
Reputation: 1324347
Assuming you are working in a branch which is not master
(as a best practice), you would simply rebase your branch on top of repoA
cd /path/to/my/local/fork/clone
git remote repoA https://github.com/<original>/<repoA>
git fetch repoA
git switch my_working_branch
git rebase repoA/master
git push -f
my issue is I want to sync my forkedRepoA:master with repoA:master
For that, this is easier:
cd /path/to/my/local/fork/clone
git remote repoA https://github.com/<original>/<repoA>
git fetch repoA
git switch master
git pull repoA master
git push
git switch my_working_branch
# resume working
Upvotes: 1