GitSvn » History » Revision 6
« Previous |
Revision 6/16
(diff)
| Next »
Andreas Kohlbecker, 10/11/2012 10:34 AM
Git Svn workflow and cheat sheet¶
NOTE: this page is still under construction - no guarantee for correctness ( not yet ).
External references and other links¶
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"
reintegrating an svn branch¶
git checkout <merge-to branch>; git merge --squash <merge-from branch>; git commit; git svn dcommit # --squash is key
delete or lock the branch afterwards!
lock an svn branch¶
not equivalent in git, thus you need to use svn for it.
checkout a fresh copy!!!:
svn co http://dev.e-taxonomy.eu/svn/branches/mybranch
lock in zsh with
svn lock <root>/**/*(.)
in bash with
find <root> -type f | xargs svn lock
commit the changes:
svn commit -m "branch locked"
Updated by Andreas Kohlbecker over 11 years ago · 6 revisions