SmartGit replaces git-svn on client-side.
#SMARTGIT SET SUBMODULE TO BRANCH SOFTWARE#
SubGit is proprietary software but it's free for small companies (up to 10 committers), academic and open-source projects. So, there is no need to use any external tools like git-svn or any other. SubGit is also availale as an add-on for the Bitbucket Server, to find out more check out here. Then you can add created Git repository as a usual submodule. Take a look at git-http-backend for that. SubGit translates SVN revision into Git commit on every svn commit and Git commit into SVN revision on every git push.Įverything you need further is to make Git repository available to committers. Īt this moment you have Subversion repository connected to newly created Git repository. You can also adjust $GIT_REPO/subgit/authors.txt to map SVN author names to Git identities. You may be asked for credentials unless those are already stored in the SVN credentials cache at ~/.subversion directory. You may refer to documenation for more details, but in general it is fairly easy to use SubGit: $ subgit configure -layout auto $SVN_URL $GIT_REPOĪbove command will detect branches layout in the SVN project and then will create empty bare Git repository ready to mirror SVN project. SubGit is server-side solution, it enables Git access to Subversion repository and vice versa. But there are two other tools which can help you: So after all this you can then use git submodule following rq's instructions.Ĭurrently git-svn doesn't support svn:externals. I'm not sure why the git gc is needed here, but I wasn't able to do a git pull without it. #fix-svn-refs.sh makes all the svn branches/tags pullable Os.system('git svn fetch & git gc -quiet')
#SMARTGIT SET SUBMODULE TO BRANCH UPDATE#
This sets up my bare repo, then I have a cron script to update it: #!/usr/bin/python On the server I run: GIT_DIR=.git git init In my case I only want read-only versions, and need a bare repo on the server. I setup one of my servers to host these git clones of the svn repos I need. I'm doing something similar to rq, but slightly different. To update to the svn HEAD, you would have to use cd /path/to/gitproject/svn-project the git project will still use the original revision that we committed earlier. So when we resync with the upstream subversion: cd /path/to/mysvnclone If "upstream" changes, then you have to update your submodule's reference. The git submodule is pegged to the revision that you give it. There is one conceptual difference between svn:externals and git submodule that may trip you up if you approach this from a subversion point of view. Git submodule add git:///project.git - svn-project Then you can add the git repository as a submodule to the original project cd /path/to/gitproject Your best bet would be to set up a mirror of the svn repository in a dedicated git repository.