Skip to content

Instantly share code, notes, and snippets.

@dcangulo
Last active August 17, 2018 08:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dcangulo/d959ddb1eee8456447d26b8b775668fb to your computer and use it in GitHub Desktop.
Save dcangulo/d959ddb1eee8456447d26b8b775668fb to your computer and use it in GitHub Desktop.
Subversion (SVN) and git commands equivalents cheatsheet

Creating a new repository

SVN

$ svnadmin create /path/to/repo
$ svn import /path/to/local/project http://example.com/svn/truck -m "Initial import"

GIT

$ git init
$ git add .
$ git commit -m "Initial commit"

Branching

SVN

$ svn copy http://example.com/svn/trunk/http://example.com/svn/branches/<new-branch>

GIT

$ git branch <new-branch>

Listing branches

SVN

$ svn list http://example.com/svn/branches/

GIT

$ git branch

Switching branch

SVN

$ svn switch http://example.com/svn/branches/<branch>

GIT

$ git checkout <branch>

Cloning a repository

SVN

$ svn checkout svn+ssh://svn@example.com/svn/trunk

GIT

$ git clone ssh://git@example.com/path/to/git-repo.git

Checking status

SVN

$ svn status

GIT

$ git status

Saving changes

SVN

$ svn add <file>
$ svn commit -m "message"

GIT

$ git add <file>
$ git commit -m "message"
$ git push

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment