Git Sheet

Release (aka get the last version without the .git folder)

git archive --remote HEAD | tar xvf -
git archive --remote HEAD sub-folder | tar xvf

Add remote origin and set upstream to and existing git repository

git remote add origin
git push -u origin master # set the upstream branch to master

Change remote origin

Remove the current origin and add a new one as above

git remote remove origin

Delete remote tag

git push origin --delete refs/tags/TAG_NAME

Delete remote branch

git push origin --delete refs/heads/BRANCH_NAME

See commit log and changes before merging into working copy

git fetch origin
Check the log and/or the changes
git log -p master..origin/master
git log origin/master
git merge origin/master

Log Graph

$ git log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short

My .gitconfig

name = liv
email =
 autocrlf = input
 safecrlf = true
 whitespace = trailing-space,space-before-tab
 co = checkout
 ci = commit
 st = status --short --branch
 br = branch
 hist = log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short
 type = cat-file -t
 dump = cat-file -p
 info = remote show origin
 please = push --force-with-lease
 default = simple
 statusHints = false