Using origin/master with git-svn

by jenny on 11 November 2010 - 07:53pm in

If you have lots of aliases in your ~/.gitconfig referencing origin/master, it can be quite annoying that git-svn provides only a remotes/trunk reference.

To fix this, from the top-level directory of your working copy:

cd .git/refs/remotes
cat trunk   # notice that trunk is just a plain file containing the hash reference of a certain commit
mkdir origin
ln -s ../trunk origin/master   # create a symbolic link from origin/master to trunk

Tadaa, that's it. You can now reference origin/master and it will always stay up-to-date with whatever trunk is referencing!