简体   繁体   中英

merge request and sync forked repo

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM