We use git as our versioning tool at work and I’ve gradually been learning a few tricks on how to speed up my development time and time spent managing my repo.

When jumping between branches, continuing your work from where you stopped last time, etc., you very often open the same files as you were editing in a previous commit. This may not be a problem if you use something like Command-T for vim or rely on the file browsing in TextMate, but often it might just be quicker to open all the files from a particular ref in git or opening all files from your branch’s diff from master/dev or something.

Paul Rosnia also made a change which makes the script try to use the $EDITOR environment variable if it exists. You can override that if you like to use a different editor than is set by your environment.

Apparently you should also be able to name the file git-open somewhere in your path, and that should have the same effect. However, it did not work for me and I have no idea why, but the git global config variable worked great.

http://www.mostlymaths.net/ Ruben Berenguel

It’s nice that it uses $Editor! This means I could use emacs Anyway, I’ve never gone too far with git: there are too many source control systems out there! I was using RCS for a long time for my LaTeX work (until I grew tired). Then tried to use CVS and SVN for a change… Currently I only use SVN for my Google Code small projects… Tried Darcs, too. Didn’t like it that much. And have only used git and mercurial for downloading things. Ah… So many programs!

Ruben

http://minhajuddin.com Khaja Minhajuddin

Renaming this script to git-open and putting it in your path would allow you to run it as “git open” (which looks much cleaner )