开发者

Synchronizing with upstream and generating clean patches in Git

What is the recommended way to synchronize a git repo with upstream?

Let's say my work is based of SVN branch A in upstream. They have moved to branch B, and C. I want to 开发者_如何学Csynchronize my work with upstream now. Should I merge, pull, rebase, cherry pick?

What is the recommended way to create a clean patch against upstream?

Should I just diff? Or should I rebase and then squash?


You should use git-svn and get branch B and C.

If you want your work on top of B or C, rebase on top of those.

git checkout branchA
git rebase --onto branchB origin/BranchA # replace branchB with branchC if you want

What do you mean by "clean" patch against upstream?

You should rebase. It's up to you if you want to squash.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜