Git SVN
Jump to navigation
Jump to search
This page is dedicated to Subversion integration in Git
References
- git-svn (1)
- Using a Subversion server on Yobi!
- Git and Subversion on Pro Git
- svn2git, Migrating a SVN repo to Git Repo
- Some handy tools at InterfacesFrontendsAndTools:
- git-sv, svneverever
- Git - SVN Crash Course (old version)
Workflow
Get a clone of subversion repository with:
# git: git clone =>
# svn: svn checkout =>
git svn clone https://www.mysvn.org/svn/project -T trunk -b branches -t tags --username='USER'
git svn clone https://www.mysvn.org/svn/project --stdlayout --username='USER' # Identical
# Clean / compress git DB if necessary...
git gc
Fetch all changes from SVN repo:
# git: git fetch =>
git svn fetch
Fetch and merge all changes from SVN repo:
# git: git pull =>
# svn: svn update =>
git svn rebase
git svn rebase -l # Only rebase against last fetched commit from upstream SVN
- In case of conflicts (see [1]):
- You are on a (no-branch) branch (with
git status
showing a .dotest file you can ignore) - Use the usual
git rebase --abort
(to bail out),git rebase --continue
(solved conflict),git rebase --skip
(no-op patch)
- You are on a (no-branch) branch (with
Send local changes to SVN repo:
# git: git push =>
git svn dcommit
Annotate changes in a file:
# git: git blame =>
# svn: svn annotate/blame =>
git svn blame fullpath # Only accept full path! (from project rootdir)
git blame file