views:

36

answers:

1

I'm working on a project that has basically 2 branches: master and "next-version".

The two are constantly changed and the next-version needs to have the latest changes from master, but I can't just merge them both, because one version is published and the other one is still on alpha.

I currently merge master to next-version everytime a change happens, but this leads to ugly history.

What's the best practice in this case?

+3  A: 

If you're keeping the branch local you can do a git rebase master on next-version. Other than that you could cherry pick if you want to avoid merges, but this could hide the relation between the branches. You could also consider merging less often.

iwein
specifically squash helps: http://www.gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html
Tim Hoolihan
Thanks! I didn't know that rebase worked like this. After struggling a bit with conflicts, I managed to do it.
Mauricio