Book Image

Git Essentials

By : Ferdinando Santacroce
Book Image

Git Essentials

By: Ferdinando Santacroce

Overview of this book

Table of Contents (17 chapters)

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.



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

svn commit –m "<message>"

git commit –a –m "<message>"

Reviewing history

svn log | less
svn blame <file>

git log
git blame <file>