Search code examples
gitgit-svn

git: svn is not a git command - Mac


I had no issues yesterday but today I cannot run git svn anymore. It says:

git: 'svn' is not a git command. See 'git --help'.

The most similar commands are
    fsck
    mv
    show

I don't know if it's relevant but since yesterday I updated npm(6.14.4) and node (v12.6.0).

I'm on macOs Catalina


Solution

  • UPDATE: SEPTEMBER 2020

    It seems the end is here. Following the original suggestion will delete subversion forever. I found a verified version of Subversion for MacOS and downloaded and installed it. I then needed to add Subversion to the $PATH variable to supersede Apple's svn (which just prints a message saying subversion is no longer included). To add it, add this line to your ~/.zprofile:

    export PATH=/opt/subversion/bin:$PATH
    

    This will fix svn. I still have not figured out how to fix git svn.

    NB: I also am aware that one can get subversion from homebrew, but homebrew is prohibited by my company's policies. If homebrew works better for somebody, please post your results here.

    ORIGINAL ANSWER: MARCH 2020

    Same thing happened to me today. After software update, git svn and svn are gone. It seems that Apple is deprecating Subversion in XCode:

    Command line tool support for Subversion — including svn, git-svn, and related commands — is no longer provided by Xcode. If you need Subversion or related command line tools, install the Command Line Tools package by running xcode-select --install. (50266910)

    In the mean time, I was able to resolve this situation by deleting the XCode command line tools and reinstalling them:

    sudo rm -Rf /Library/Developer/CommandLineTools
    sudo xcode-select --install
    

    After that, git svn and svn were back. Hopefully that will give us a stay of execution before final deprecation and deletion.