
\begin{DoxyCode}
git add readme.md   # adds the changes of the file `readme.md` to the staging area
git add .           # adds all changes of files in the current directory (recursively) to the staging area
git add --all       # adds all changes of files in the repository to the staging area
git commit -a       # executes a commit that automatically stages all changed and deleted files before
\end{DoxyCode}


make sure to do\+:


\begin{DoxyCode}
git config --global merge.ff false
git config merge.ff false
\end{DoxyCode}


A commit message should have the following syntax\+: {\ttfamily component\+: short change description}

For a clean and meaningful log the commit message should fulfil the following\+:


\begin{DoxyItemize}
\item use imperative in the subject line
\item the subject line should not be longer than 50 characters
\item start the subject line with the module name (e.\+g. resolver\+:, cpp bindings\+:)
\item separate subject from body with a blank line
\item in the body describe in detail what you did, and possibly why
\item metadata like \char`\"{}\+Fixes \#123\char`\"{} should be kept at the bottom of the commit message and definitely not in the title
\end{DoxyItemize}

Most commits should have a longer description in the body.

To list all remote branches use\+:


\begin{DoxyCode}
git branch -a
\end{DoxyCode}


To checkout a remote branch initially use\+:


\begin{DoxyCode}
git checkout -b <branchname> origin/<branchname>
\end{DoxyCode}


Once you have done this, it will be a local branch, too. Following remote branches should exist\+: \begin{DoxyVerb}master
\end{DoxyVerb}


This is the development branch. Please try to not work directly on it, but instead you should use feature branches. So the only commits on master should be non-\/fastforward merges from features branches. Commits on master should always compile and all test cases should pass successfully. (see config option above)

You should always make your own feature branch with\+:


\begin{DoxyCode}
git checkout -b <feature-branch-name>
\end{DoxyCode}


On this branch it is not so important that every commit compiles or all test cases run.

To merge a branch use (no-\/fastforward)\+:


\begin{DoxyCode}
git merge --no-ff <branchname>
\end{DoxyCode}


If you already did some commits, but want them in a branch, you can do\+:


\begin{DoxyCode}
git branch foo
git reset HEAD^^  # for 2 commits back
git reset origin/master

git-ref-log # recover
\end{DoxyCode}
 