*********** TYPICAL WORKFLOW ******************************* git pull <=============== git add git status git commit -m'' git push ===============> " PULL, ADD, COMMIT AND PUSH " (Sensei Miyagi) ************************************************************* MAKE A CLONE <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $ git clone user@url:/path # via ssh $ git clone git://url/path # via git protocol view status with STATUS <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $ git status view log with LOG <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $ git log ADD your modifications (locally) <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $ git add file commit your changes (locally) <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $ git commit -m "some text explaining what you did" PULL to UPDATE <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $ git pull origin # fetch and merge in one step PUSH to make public your CHANGES <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $ git push origin TIME TRAVEL <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< revert "file" to a previous version $ git checkout file revert to last commit: $ git checkout HEAD^ file revert to two steps in commit history $ git checkout HEAD^^ file revert 5 steps in time $ git checkout HEAD~5 file go back to latest version: $ git checkout HEAD file view diff with DIFF <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $ git diff HEAD^ # between last commit and current state $ git diff HEAD^^^ # between three commits and current $ git diff HEAD~10 # between ten commits ago and current $ git diff HEAD~10..HEAD^ # between ten commits ago and previous Solve a merge CONFLICT <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Git-status will list those files as "unmerged", and the files with conflicts will have CONFLICT MARKERS added. All you need to do is edit the files (look for the conflict markers) to resolve the conflicts, and then $ git add $ git commit or $ git commit -a Note that the commit message will already be filled in for you with some information about the merge. BRANCHES <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Create a branch $ git branch List branches $ git branch Checkout the branch $ git checkout Delete branch $ git branch -d Merge branches git merge Commit a branch to the repo origin git push origin ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::