Project

General

Profile

Actions

GitSvn » History » Revision 2

« Previous | Revision 2/16 (diff) | Next »
Andreas Kohlbecker, 10/11/2012 09:55 AM


Git Svn workflow and cheat sheet

cloning and EDIT svn repo

Clone a svn sub-repository. It is important to specify the sub folders in trunk branches and tags!!

Here the subrepo drupal is used in the example:

 git svn clone -T trunk/drupal -t tags/drupal -b branches/drupal http://dev.e-taxonomy.eu/svn ./

create git ignore:

git-svn show-ignore > .gitignore

reference on git/svn command equivalents

  • svn up => git svn rebase

  • svn commit => git svn dcommit (will commit latest commits in git to the svn repository

revering via reset

whipe out all changes in working directory, and replace with HEAD revision

git reset --hard HEAD 

resolving merge conflicts

 git mergetool

keep either file in merge conflicts

There’s two unmerged files here. According to the git checkout manpage, there’s a --theirs and --ours options on the command. The former will keep the version of the file that you merged in, and the other will keep the original one we had.

The following commands will keep the original file for index.html, and then use the merged in file only for _layouts/default.html.

git checkout --ours filename.c
git checkout --theirs filename.c
git add filename.c
git commit -m "using theirs"

Updated by Andreas Kohlbecker over 11 years ago · 2 revisions