Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have installed git and svn with homebrew on my mac running 10.7.4. There are two versions of svn on my machine and I have set up my path to check for homebrew things first. Unfortunately git is using the wrong version of svn, so either it installed it's own version somewhere else, or it is ignoring my path.

$ git --version
git version 1.7.10.4

$ svn --version
svn, version 1.7.5 (r1336830)

$ git svn --version
git-svn version 1.7.10.4 (svn 1.6.17)

$ /usr/bin/svn --version
svn, version 1.6.17 (r1128011)

$ which git svn
/usr/local/bin/git
/usr/local/bin/svn

$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin:/usr/local/git/bin

I have looked briefly at git-svn.pl, unfortunately I don't know perl and I couldn't determine if the path was being set in there. So, why doesn't git use my path and how can I make it use the version of svn I need?

Thanks for reading.

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

git svn is not using your $PATH at all. It's using $SVN::Core::VERSION, as you can see in git-svn.perl, ll. 408 - 412 in git version 1.7.11.rc3:

sub version {
        ::_req_svn();
        print "git-svn version $VERSION (svn $SVN::Core::VERSION)\n";
        exit 0;
}

Neither /usr/local/bin/svn nor /usr/bin/svn control this version. I was able to replicate your issue on OSX 10.7.4 and corrected it with via the 'cpan' shell:

sudo cpan;   # sudo required on the mac for the subversion make
cpan[1]> install SVN::Core

Hit Enter at every prompt and keep the defaults. It'll take a while, and might require installing some dependencies. My local had everything I needed but I have an unhealthy number of random libraries installed. Type exit or Ctrl+C after it finishes compilation. Now try git svn --version:

$ git svn --version
git-svn version 1.7.11.rc3.5.g2ae48a9 (svn 1.7.3)
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.