How to make git-svn use specific version of SVN?

On my Linux machine I use both SVN and Git.

To make my life easier I added
source /opt/svn/linux64/ix86/svn_1.8.5/interface/startup/svn_1.8.5_64.env
to my .bashrc and thus writing
svn –version
shows 1.8.5 as expected.

  • how to start bash in a directory in windows .bat?
  • Commands in a Git Script Functions (Windows) Not Working As Expected in Sub Folder Under a Git Repo
  • Launch TestNG suite from bash script
  • Hiding GitHub token in .gitconfig
  • Modifying Jenkins Description for a build
  • Rename folder in Git. All branches and all revisions
  • But when having this git-svn fails upon checkout. This happens in Git and is an already known incompatibility (see for example here).

    I can easily work around it by sourceing SVN version 1.7.9. But that requires me to restart SSH connection. And then after performing git-svn operation restarting again. (In both cases .bashrc has to be edited!)

    I could also just switch to SVN 1.7.9 but that would require me to downgrade all SVN tools I use including TortoiseSVN which I have on my Windows machine (and which I use from time to time on checkouts made on shared network drives).

    So is there a “non-intrusive” way (so I can do it only for myself – the Linux is on a shared server!) to make git-svn use the 1.7.9 version while command line will still use 1.8.5?

    /opt/svn/linux64/ix86/svn_1.8.5/interface/startup/svn_1.8.5_64.env contains following:

    old_value=`eval echo '$'${1}`
    eval ${1}=`echo ${old_value}|awk '{ n=split($1,parts,":"); printf "%s", toadd ;
    for (i = 1; i <= n; ++i) if ( toadd != parts[i]  ) printf ":%s", parts[i]; }' toadd=${2}`
    if [ -n "$SVN_STARTUP" ]; then
      unset SVN_STARTUP
      . $SVN_TMP
      # setum and setmake can overrule SVN_VERSION
      if [ -z "$SVN_VERSION" ]; then
        export SVN_VERSION=svn_1.8.5
      export SVN_HOME=/opt/svn/linux64/ix86/$SVN_VERSION
      add_to_env PATH $SVN_HOME/bin
      export PATH
      add_to_env MANPATH $SVN_HOME/share/man
      export MANPATH
      add_to_env LD_LIBRARY_PATH $SVN_HOME/lib
      export LD_LIBRARY_PATH

    As to Perl:

    • perl --version shows 5.8.8,
    • which perl shows /usr/bin/perl which is not a link, /usr/bin contains also perl5.8.8 which seems (by diff) to be the same,
    • find / -name finds (so far…) /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/SVN/

  • Configure GitLab with open LDAP
  • Finding the date/time a file was first added to a Git repository
  • git: create “temporary” integration branch
  • Automatically skip empty commits when using git rebase
  • Seamless git svn setup
  • hg convert abort: '\n' and '\r' disallowed in filenames:
  • One Solution collect form web for “How to make git-svn use specific version of SVN?”

    First of all that environment script isn’t really changing your bindings to Subversion fully. In fact it’s actually mixing bindings with some other version of the libraries. In general this is likely to work because Subversion makes a lot of effort to keep our APIs compatible and you should end up with the same version of the various Subversion libraries (which is important).

    In order to correctly use the Subversion Perl bindings that go with the libraries you’ll need to add the path to where the Perl bindings are at. Perl handles this with the PERL5LIB environment. Which works similarly to your PATH or LD_LIBRARY_PATH environment variables. Other languages would need similar things (but git-svn only uses Perl so that’s not important in this case).

    Beyond that you should just be able to source the script in your shell to change the libraries because it adds the libraries to the start of the values (which will be searched in the order given). So you should just be able to run source envfile or . envfile.

    If you wanted you could simply wrap git with something like this and put it on your path (you could alias it as well but scripts wouldn’t see it).

    . /opt/svn/linux64/ix86/svn_1.7.9/interface/startup/svn_1.7.9_64.env
    git "$@"

    Where $SOMEPATHTOPERLLIS is replaced with whatever the actual path to the Perl5 files are in your install. I can’t tell you what this it varies from system to system. If you search for a file named you can usually find the general area. You should only need to point that at where you found that file a few levels up.

    Git Baby is a git and github fan, let's start git clone.