Initialize local repository

git init --bare example.git

Use local repository

git clone ~/path/to/example.git
cd example
echo "Hello world!" > README
git add README
git commit .
git push ~/path/to/example.git master

Configure current working copy

git config "John Doe"
git config

Clone from bare repository via SSH

git clone

Clone from bare repository using local file system

git clone ~/path/to/example.git

Create bare repository from working copy

git clone --bare -l example example.git

Remove from index

git rm -r --cached .
git add .

Shallow cloning (get only state the latest commit)

git clone --depth 1

Shallow cloning (get only state of the latest commit) for specific tag/branch

git clone --depth 1 --branch example-tag