문제

I forked a public repo on github to do some changes. I created a new branch and implemented my changes there. Now I want to get the new commits from the upstream repo, but I was just able to sync the upstream commits to my master repo not to the new branch. How do I sync from upstream to my new branch instead of master?

도움이 되었습니까?

해결책

How do I sync from upstream to my new branch instead of master?

You are supposed to sync master first, then rebase your branch on top of the newly updated master.

git pull upstream master
git checkout yourBranch
git rebase master
git push -f origin yourBranch

That supposes you have a remote named 'upstream' referring to the url of the original repo (that you have forked)

See "Pull new updates from original Github repository into forked Github repository" for the "git remote add upstream" command example.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top