开发者

Synchronizing with upstream and generating clean patches in Git

开发者 https://www.devze.com 2023-03-14 13:31 出处:网络
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.

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

精彩评论

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