I’ve got a trunk setup where all my production code goes.
Then I have a debug branch (parent is trunk) which I add debugging code such as logging, var dumps, etc… this should never be in production. This branch rarely changes.
Lastly I have a feature branch (parent is debug) where I do all my coding with the benefits of debugging. There are constant commits to this branch.
I just want to know if there is an easier way to move my feature code to the trunk. This is what I currently do:
- Commit all changes to my
featurebranch - Switch to
masterandgit svn rebasechanges from other devs. rebasemyfeaturebranch onto themasterbranch (git rebase --onto master debug feature)mergefeature tomastergit svn dcommitchanges to other devsrebasedebugtomaster(git rebase master debug)- delete
featurebranch - create a new
featurefrom thedebugbranch.
I would say that your work-flow is pretty optimal. I would consider cherry-picking to be an overkill (but it depends on the number of commits).
What you could do is squash all the commits into one and cherry-pick/rebase just this one.
And btw, why just don’t write a simple script if it is something you do all the time? Git is a bit low level tool, so writing extra scripts to help with repetitive tasks is a very good idea.