Git vs. SVN commands
Git has become the dominant version control system in recent years, especially in the open-source community, while SVN has declined. If you’re switching from SVN to Git here is a quick reference comparing common commands.
Comparison table of Git-Subversion commands
| Command | Operation | Subversion |
|---|---|---|
| git clone | Copy a repository | svn checkout |
| git commit | Record changes to file history | svn commit |
| git show | View commit details | svn cat |
| git status | View status | svn status |
| git diff | View differences | svn diff |
| git log | View log | svn log |
| git add | Add | svn add |
| git mv | Move | svn mv |
| git rm | Delete | svn rm |
| git reset | Cancel change | svn revert1 |
| git branch | Create a branch | svn copy2 |
| git checkout | Switch branches | svn switch |
| git merge | Merge | svn merge |
| git tag | Create a tag | svn copy2 |
| git pull | Update | svn update |
| git fetch | Update | svn update |
| git push | Changes reflected on the remote | svn commit3 |
| .gitignore | Ignore file list | .svnignore |
- Revert in SVN cancels a change, but Revert in Git negates a change.
- Branch and tag are the same in SVN but different in Git.
- SVN does not have the concept of a local repository vs. remote repository; accordingly, a commit is directly reflected in the remote.