0

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 synchronize 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?

1 Answer 1

0

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.

5
  • Fine, rebase, but what next? I make a copy of my stable branch, rebase it and then merge back into stable? Jun 23, 2011 at 12:08
  • depends on the workflow. If you are to share it, then commit to SVN with git-svn. If it has to be used on yet another branch, yes you can merge it. Jun 23, 2011 at 16:42
  • The SVN is upstream. I'm maintaining a fork. Jun 23, 2011 at 17:26
  • Then just push it to where others can see it? github? unfuddle? Jun 23, 2011 at 18:02
  • I have a public repository with a stable branch. I want to sync my repository with upstream. I can't "just push". Jun 23, 2011 at 18:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.