Git SVN: Difference between revisions

From miki
Jump to navigation Jump to search
(→‎Workflow: n be used to solve problem in the 1st method where some line formats are not correctly rendered in the EPS. This procedure requires to have a PDF printer installed, such as PrimoPDF.)
Line 46: Line 46:
# git: git push =>
# git: git push =>
git svn dcommit
git svn dcommit
</source>

Annotate changes in a file:
<source lang="bash">
# git: git blame =>
# svn: svn annotate/blame =>
git svn blame fullpath # Only accept full path! (from project rootdir)
git blame file
</source>
</source>

Revision as of 10:25, 12 July 2011

This page is dedicated to Subversion integration in Git

References

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)

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