git_branching

Quick Profile

Alex Ooi Profile Picture
Hometown: Melbourne, Australia
Specializations: Java, Ruby on Rails
University: Software Engineering & Economics, Melbourne University
High School: VCE, Melbourne High School
Links:
 

Popular Articles

Wednesday, March 30, 2011

We've recently needed to manage some remote branches in GIT (create and delete them). Having stumbled around google for ages trying to figure out how to do this seemingly simple task, we came up with this list of 5 commands:

  1. git push origin listing_edit_steps_spike:refs/heads/listing_edit_steps_spike
  2. git fetch origin
  3. git config branch.listing_edit_steps_spike.remote origin
  4. git config branch.listing_edit_steps_spike.merge
  5. git checkout listing_edit_steps_spike

These are the commands that the git_remote_branch tool (http://grb.rubyforge.org/) uses when you use it to create a remote branch. Whats with all the config updates? Whats with the origin fetching? And what is with all of those damn confusing arguments?

Honestly, as a developer, I couldn't care less. I just want to be able to manage remote branches quickly and easily and not have to freken google for 15 minutes everytime I need to get the job done!

Apparently GIT is supposed to be our saviour. If thats the case, then I'd rather go on living in "hell"...

Sound Convoluted and overly complicated?!

Yes ... it is ... Especially when compared to this:

svn copy [SRC] [DEST]

But apparently SVN is crap, right?

Comments ...

Would you use a cannon to kill a fly? Your team sucked. Tell them to use the right tool for the job.
Posted by tester on Sunday, April 03, 2011 at 04:39 AM
Mr. Tester ... as expected, your subtlety and tactfulness never ceases to amaze me :D
Posted by Alex Ooi on Monday, April 04, 2011 at 03:27 PM
when i create a branch i do this:

create new branch:
git checkout -b my_new_branch

push branch to origin:
git push origin my_new_branch

simple as that.

all the config stuff you had going there, im not even sure what it means. i suppose its a more convoluted way to things, or the environment is not set up correctly.

sure an svn copy seems easier, what you are missing is an example of the source and destination, which looks something like this (from google hehe):

svn copy http://svn.example.com/path/to/repository/trunk http://svn.example.com/path/to/repository/tags/snapshot-of-trunk

i dont see that as simple. plus there is the other end of creating branches which youve neglected. merging! git is kinder to use when merging needs to happen :)
Posted by aaron on Wednesday, April 13, 2011 at 04:44 PM
ok ... you have convinced me... GIT is wonderful!
Posted by Alex Ooi on Wednesday, April 13, 2011 at 05:21 PM

Add a Comment

*
*
You must answer the following simple maths question before your comment will be accepted.
*