Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I keep an svn:external up to date using git-svn?

Treating my repository as a SVN repo, I get:

svn co http://myrepo/foo/trunk foo ... foo/   bar/   baz/ -> http://myrepo/baz/trunk 

Treating it as a Git repo, I get:

git svn clone http://myrepo/foo --trunk=trunk --branches=branches --tags=tags ... foo/   bar/ 

I can clone baz to my local machine elsewhere and add a symlink, but that's just a hack. Is there a way to have git svn rebase automatically pull in those changes when it updates everything else, just like svn up does?

like image 575
James A. Rosen Avatar asked Dec 08 '08 19:12

James A. Rosen


People also ask

Can you use Git and SVN together?

git-svn is a specialized tool for Git users to interact with Git repositories. It works by providing a Git frontend to an SVN backend. With git-svn, you use Git commands on the local repository, so it's just like using normal Git. However, behind the scenes, the relevant SVN commands are sent to the server.

Is Git better than SVN?

Many people prefer Git for version control for a few reasons: It's faster to commit. Because you commit to the central repository more often in SVN, network traffic slows everyone down. Whereas with Git, you're working mostly on your local repository and only committing to the central repository every so often.

Is SVN and Git the 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.


1 Answers

The best means of integrating svn externals with git-svn that I've seen is this script, which clones your externals into a .git_externals/ directory and creates the symlinks and exclude files you need. I find this a simple and direct solution. YMMV.

Here is an older overview of other options for dealing with svn externals with git-svn. To me they look a little over-complicated and liable to break under subsequent Git use.

like image 178
Paul Avatar answered Sep 20 '22 08:09

Paul