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 15: Line 15:


== Workflow ==
== Workflow ==
First get a clone of subversion repository with:
Get a clone of subversion repository with:

<source lang="bash">
<source lang="bash">
# git: git clone =>
git svn clone https://www.mysvnserver.org/svn/project -T trunk -b branches -t tags --username='USER'
# 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
</source>
</source>


Fetch all changes from SVN repo:
Fetch all changes from SVN repo:

<source lang="bash">
<source lang="bash">
# git: git fetch =>
git svn fetch
git svn fetch
</source>

Fetch and merge all changes from SVN repo:
<source lang="bash">
# git: git pull =>
# svn: svn update =>
git svn rebase
git svn rebase -l # Only rebase against last fetched commit from upstream SVN
</source>
:In case of conflicts (see [http://tech.hickorywind.org/articles/2008/06/10/larry-vs-the-git-rebase-merge-conflict]):
:* You are on a (no-branch) branch (with <code>git status</code> showing a <tt>.dotest</tt> file you can ignore)
:* Use the usual <code>git rebase --abort</code> (to bail out), <code>git rebase --continue</code> (solved conflict), <code>git rebase --skip</code> (no-op patch)

Send local changes to SVN repo:
<source lang="bash">
# git: git push =>
git svn dcommit
</source>
</source>

Revision as of 09:33, 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