This tutorial collects information for users of git as svn client, using git-svn. Please consider reading GitSvnCrashCourse, and the git-svn cheatsheet. As Git is distributed, commits (aka change sets) are referenced by hashes instead of svn's serial version numbers. Git tracks contents, not files or directories. Consider to use a real svn client to rename directories, as git-svn produces a lot of renames in svn, instead of one like the original.
checkout / clone, log
git svn clone -r 400:HEAD https://svn.whatebber.org/repo/trunk folder # choose a recent commit git log -5
Create a .gitignore file on the toplevel to replicate svn's ignore properties.
echo "folder/or/file/to/ignore" > .gitignore
commit to local Git
Git automatically tracks contents and therefor automatically detects all changes done with file browsers, programming tools etc.
git add --all git commit -m "whatebber"
commit to remote SVN
To see what is going to be committed one can choose the following options.
gitk git-svn.. gitk git log remotes/git-svn.. --oneline git svn dcommit --dry-run
To really commit
git svn dcommit
Undo (backout, revert) changes and commits is done with standard git commands.
Things already committed to svn can be reverted:
git revert <hash> git svn dcommit
Things in the working tree can be reset (reverted) to what is checked in:
git reset --hard
- git-svn homepage: http://www.kernel.org/pub/software/scm/git/docs/git-svn.html
- Git cheat sheets: Zack Rusin's, in A4 by Jan Krüger, 2 sheets by Jan Krüger