Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git-svn not a git command?

Tags:

git

svn

git-svn

People also ask

What is Git SVN command?

Git SVN is a feature in Git that allows changes to move between a Subversion and a Git repository. Git SVN is a good feature to use if you need to allow changes to go between Git and SVN repositories.

Are SVN and Git same?

The difference between Git and SVN version control systems is that Git is a distributed version control system, whereas SVN is a centralized version control system. Git uses multiple repositories including a centralized repository and server, as well as some local repositories.

Can you use SVN with Git?

The git-svn tool is an interface between a local Git repository and a remote SVN repository. Git-svn lets developers write code and create commits locally with Git, then push them up to a central SVN repository with svn commit-style behavior.

What is SVN and Git and in Git why we use branches?

SVN has a Centralized Model. In git every user has their own copy of code on their local like their own branch. In SVN there is central repository has working copy that also make changes and committed in central repository. In git we do not required any Network to perform git operation.


I just check on my newly installed ubuntu box and it wasn't installed even with git-core installed. A simple:

sudo apt-get install git-svn

or your distro equivalent should fix it.


On Ubuntu:

sudo add-apt-repository ppa:git-core/ppa
apt-get update
sudo apt-get install git-svn

I am not sure that git svn has ever worked with recent Git Windows distribution (post 1.5.6).

Many problems have been reported before, so git svn may very much be not included in current msysGit releases.

Another current active "Git on Windows" development mingw.git does state in its README that svn does not work.

This thread of Msysgit does suggest that git svn may be reintegrated at some points, but progress are still slow.


Update: from MSysGit1.6.2 (early March 2009), git-svn works again. See this SO question.


Update: with a modern (2017) Git for Windows 2.x, git svn is already included.
No need for sudo apt-get install git-svn, which would only be possible in a WSL (Windows Subsystem for Linux) shell session anyway.


Under my system I've had this trouble:

$ git svn
Can't locate SVN/Core.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/5.10.0
/usr/lib/perl5/5.10.0/i486-linux-thread-multi
/usr/lib/perl5/5.10.0
/usr/lib/perl5/site_perl/5.10.0/i486-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.8
/usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.10.0/i486-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.10.0
/usr/lib/perl5/vendor_perl/5.8.8
/usr/lib/perl5/vendor_perl .) at
/usr/libexec/git-core/git-svn line 29.

because I don't have Subversion Perl bindings installed. Try installing them and running the command again.


For posterity: On CentOS 7, just run sudo yum install git-svn.


It wasn't installed on my fresh install of Ubuntu on WSL -

sudo apt install git-svn

sorted it:

❯ git svn
git-svn - bidirectional operations between a single Subversion tree and git
...

I had the same error under Cygwin 1.7. It was solved by installing the git-svn package with Cygwin setup.