GIT cheat sheet

Initial setup per host:

git config --global user.name "Alex.."
 git config --global user.email alex@mail.at

Configuration:

Get rid of colors:

git config --global color.ui false

Tasks:

Start a new git repository in the current directory:

git init

Copy git repository from server:

git clone <url>

Update git repository from server:

git pull

Add files for the next commit:

git add <filename|directory>

Commit changes locally:

git commit
 use "-a" to auto add changed files to commit

Push repository changes to server:

git push [<server> <branch>]

Set default server branch for push and pull (track server):

git push -u <server> <branch>

List remote servers:

git remote [-v[v]]

Add remote server:

git remote add <name> <remoteurl>

Setup new git server directory

mkdir project.git
 cd project.git
 git init --bare