Subversion at the Command Line for Git Users

I love the command line and have experience with git . I shied away from git svn because it might confuse my team. So here is my list of svn usage and commands and their similar commands in git . This is a work in progress. If anything doesn't seem quite right, please let me know.

Documentation

Working with remotes

svn checkout <uri> vs git clone <uri>; git pull;

svn update -r238 vs git checkout fder3fd

svn info . vs git remote -v

svn ls <uri>/branches --verbose vs git branch --all -vv

svn switch<uri>/branches/<branch_name> vs git checkout <branch_name>

svn status vs git status

Add / commit / push

svn commit -m "Some message" vs git commit -m "Some message"; git push

Fixing mistakes

svn revert foo.txt vs git checkout -- foo.txt

svn revert * --recursive vs git reset --hard HEAD

Branching and merging

svn copy <url> branches/mybranch : git checkout -b mybranch

History

svn log -limit 5 vs git log -5

svn log --revision 1:HEAD

svn log --stop-on-copy

Using PowerShell

@(svn status) -match '^M'

@(svn status) -match '(^ L)

@(svn status) -match '^\?' | % { ($_ -split '\?\s*')[1] } | % { ri $_ -force -recurse } vs git clean -f -d

(svn help status)[0..25]