Common commands in the day-to-day usage of git.

Configure global email

git config --global user.email "user@example.com"

Configure global name

git config --global user.name "username"

Generate SSH key

ssh-keygen -t rsa -C "user@example.com"

View SSH key fingerprint

ssh-keygen -l -f ~/.ssh/id_rsa.pub

Add a remote repository

git remote add origin repo_url_here

Remove a remote repository

git remote rm origin

Push 'master' branch to remote repository

git push origin master

Rename a local branch

git branch -m old_branch_name new_branch_name

Delete remote branch

git push origin :old_branch

Exclude files but include a specific file in .gitignore

*.rar  #excludes all files ending in .rar
!myfile.rar # includes myfile.rar if present

Tagging a commit (give the first 7 chars of the commit)

git tag v1.0.0 dee70ed
git push origin --tags