Comparing Git and Subversion commands

Here you can find a short and partial recap table, where I try to pair the most common Subversion and Git commands to help Subversion users to quickly shift their minds from Subversion to Git.

Subversion

Git

Creating a repository

svnadmin create <repo-name>
svnadmin import <project-folder>

git init <repo-name>
git add .
git commit –m "Initial commit"

Getting the whole repository for the first time

svn checkout <url>

git clone <url>

Inspecting local changes

svn status
svn diff | less

git status
git diff

Dealing with files (adding, removing, moving)

svn add <file>
svn rm <file>
svn mv <file>

git add <file>
git rm <file>
git mv <file>

Committing local changes ...

Get Git Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.