Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the best way to transfer a GIT-SVN debug->feature branch to trunk?

Tags:

git

git-svn

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:

  1. Commit all changes to my feature branch
  2. Switch to master and git svn rebase changes from other devs.
  3. rebase my feature branch onto the master branch (git rebase --onto master debug feature)
  4. merge feature to master
  5. git svn dcommit changes to other devs
  6. rebase debug to master (git rebase master debug)
  7. delete feature branch
  8. create a new feature from the debug branch.
like image 570
JD Frias Avatar asked Aug 30 '10 17:08

JD Frias


1 Answers

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.

like image 130
Šimon Tóth Avatar answered Oct 12 '22 23:10

Šimon Tóth