4

With SVN, I have the following setup:

/tags/ /trunk/ /branches/ /branches/my_feature /branches/my_other_feature 

I want to keep all the branches in sync with mainline trunk, so I periodically run an svn merge for the branch for trunk.

However, I also want to keep all the branches in sync with one another, so as to avoid conflicts, as any given branch's lifetime can be a couple of months or more. If I have a dozen branches, I would have a nasty mesh with SVN, and it would be impractical.

My question is, would using Git instead of SVN help with keeping branches in sync with one another and trunk?

2
  • Not sure if this will make a difference, but the project in question -- do you work on it with a lot of others, just a few or is it a solo project (for the time being)? Commented Aug 19, 2009 at 19:30
  • About half a dozen other developers. Commented Aug 20, 2009 at 16:43

3 Answers 3

6

It would help you keep both branches in sync with trunk by doing a rebase.

While using the branch my_feature, execute:

git rebase master 

And that will bring your changes in the master (trunk) branch to my_feature.

About keeping my_feature and my_other_feature in sync, its the same principle if one is a descendant of the other. If my_feature is not a descendant of my_other_feature or viceversa, I don't know the answer.

Sign up to request clarification or add additional context in comments.

Comments

2

Yes, for the most part. All three of the modern DVCSes (Git, Mercurial, and Bazaar) can tell when you last merged and won't try to remerge changesets that have already been merged.

You might run into some weird edge cases if you're doing some really tricky stuff, but even if you do it will be miles better than using SVN.

Comments

0

Note that you should use Git completely instead of SVN to get the desired functionality. If you merely use git as a front-end to SVN (vai git svn), this will likely cause things to not appear correct to SVN users.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.