2

My personal git-svn cheatsheet/reference

>One of my clients keep their repository in svn, so I started playing with git-svn. Hopefully, it will allow me to be able to use a single revision control system, and to forget about svn 😉

Here is my personal cheatsheet/reference for git-svn. It is published here so that I can reach it from anywhere, and thinking that someone else may also find it useful. I keep this in a text file, so it is copied verbatim here.

Mac ports package: git-core

Note that the command is "git svn", not "git-svn", but man page is git-svn(1).

git svn init
--stdlayout # if svn repo has the usual trunk/branches/tags structure
--prefix=[url prefix] # if svn repo does not follow the stdlayout
--trunk=[trunk dir] # |
--tags=[tags dir] # |
--branches=[branches dir] # ---
--username=[user name] # svn repo user name (for https, http etc.)

git svn fetch # fetch unfetched changesets from svn repo
git svn clone # issue an init and a fetch (can use almost all options of both)

git svn rebase # 'svn update' Fetch changesets to current HEAD and rebase
git svn dcommit # 'svn commit' Send uncommitted commit diffs before HEAD to svn.

git svn branch # create a new branch in the svn repository
git svn tag # create a new tag in the svn repository

git svn log # 'svn log'. Can also show git commit hashes with --show-commit
git svn blame # 'svn blame'. Can also show in git blame format
# - with svn changesets numbers using --git-format
git svn find-rev # find the git commit for given svn revision rN

git svn info # 'svn info'
git svn propget # 'svn propget'
git svn proplist # 'svn proplist'
git svn show-externals # 'svn propget svn:externals'

2 Comments

  1. >Hmm.. Svn with local branching would definitely be better than svn w/o local branching :)

    I haven't seen how it's done. Roy, could you please send me some links to local branching in svn?

  2. >While I don't want to start a flame that git is better/worse then svn, I suppose subversion 1.7 is a huge leap forward. It includes the next generation work copy which started to look like very similar to the git. I haven't tried it myself yet, but svn with local branching support is pretty cool :)

Leave a Reply to --eg Cancel reply

Your email address will not be published. Required fields are marked *