Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using git with svn

Tags:

git

svn

git-svn

I have to use svn as source code management tool, but I want to use git branches locally. I wonder if it works without problems and what's the best approach. I read about 'git svn', but it looks like I would have to sync the whole svn repositoy to use it. That's not an option. Assuming I'm the only developer (not git push/pull between developers) and want to use git only 'locally'. What's the best approach? Just 'git init' on my local checked out project? And to use both tools in the same folder? Are there better approaches?

like image 374
Achim Avatar asked Jun 08 '11 08:06

Achim


People also ask

Does SVN work with GitHub?

GitHub repositories can be accessed from both Git and Subversion (SVN) clients. This article covers using a Subversion client on GitHub and some common problems that you might run into. GitHub supports Subversion clients via the HTTPS protocol. We use a Subversion bridge to communicate svn commands to GitHub.

Should I use git or 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 obsolete?

While SVN is no longer the most used VCS, it has managed to establish itself in a few very niche areas. Features like customizable access control to project files and a central server are some reasons why developers may still be using SVN.


2 Answers

You do not need to sync the whole repository. You can clone the modules you require:

git svn clone --stdlayout http://myrepo/module

That will pull down the whole history for that module. You can just grab HEAD:

git svn clone --stdlayout -r HEAD http://myrepo/module

This is how I work most days.

There are lots of related questions about git-svn workflow... just follow the links to the right of this answer :-)

like image 126
Johnsyweb Avatar answered Nov 14 '22 20:11

Johnsyweb


Use git svn. You don't have to sync whole repository—you can sync only particular branches and you can skip old history. However, you need to sync all revisions since than on the selected branches. It would be much less useful without that.

like image 37
Jan Hudec Avatar answered Nov 14 '22 22:11

Jan Hudec