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


make sure to do\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{git config --global merge.ff false}
\DoxyCodeLine{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}{0}
\DoxyCodeLine{git branch -a}
\end{DoxyCode}


To checkout a remote branch initially use\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{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) \begin{DoxyVerb}debian
\end{DoxyVerb}


Is the branch to be used to build debian packages. It additionally contains the debian folder. Only debian related commits should be on the debian branch -\/ otherwise it should only contain --no-\/ff merges from master. (see config option above)

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


\begin{DoxyCode}{0}
\DoxyCodeLine{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}{0}
\DoxyCodeLine{git merge --no-ff <branchname>}
\end{DoxyCode}


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


\begin{DoxyCode}{0}
\DoxyCodeLine{git branch foo}
\DoxyCodeLine{git reset HEAD\string^\string^  \# for 2 commits back}
\DoxyCodeLine{git reset origin/master}
\DoxyCodeLine{}
\DoxyCodeLine{git-ref-log \# recover}
\end{DoxyCode}
 