Git for Git Users

Commit messages First line: Imperative subject line (max. 50 chars) One free line Other relevant information, reasoning, explanations, etc. Pulling When the server has changes unrelated to yours: git pull --rebase Make this the default: git config --bool pull.rebase true In this case, git pull --merge can be used to restore previous behavior. When the server has changes and you do not: git pull --ff-only Otherwise: git pull (Works always, but sometimes not as pretty) Other tricks git reset --soft HEAD^ moves changes from the last commit back to the index so that they can be edited.

Git+SSH Cheatsheet

Git Repository create: git init clone: git clone git@host:username/repo.git Commit Commit all changes: git commit . -m "message" Add all files, including untracked files: git add -A Change message of last commit: git commit --amend -m "message" Branch create: git checkout -b new-branch (CAUTION) reset when broken: git reset --hard @{u} (DANGER) Merge and Rebase Merge = create commit from two parallel tracks of changes; Rebase = Act like changes happened in sequence.

Systemd Unit Service Cheatsheet

Create a file /etc/systemd/system/xyz.service: [Unit] Description=Some description of the service [Service] ExecStart=/usr/bin/true #Restart=always [Install] WantedBy=multi-user.target