<docbook><section><title>GitStrategy</title><title> Using Git With OpenLink Software&#39;s Open-Source Projects</title> Using Git With <ulink url="OpenLink">OpenLink</ulink> Software&#39;s Open-Source Projects
<bridgehead class="http://www.w3.org/1999/xhtml:h2"> Introduction</bridgehead>
<para>By design git can be used in a variety of ways.
 In fact it allows so many ways of managing ones code that it is easy to mess everything up.
 Thus, it is important to stick to fixed policies and rules when using a git repository collaboratively.
 This document states the setup and the policies used with the VOS git-repository.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h2"> Repository Setup</bridgehead>
<para>We use a moderated development model where there is one &quot;official&quot; repository that is maintained by <ulink url="OpenLink">OpenLink</ulink> Software.
 Only <ulink url="OpenLink">OpenLink</ulink> can push changes to this repository.
 Developers work in their own clones of the repository and send merge requests or patches to the administrator.
 (Details of this procedure are not clear yet.
 We might want to setup or use a web frontend.)</para>
<para> </para>
<bridgehead class="http://www.w3.org/1999/xhtml:h2"> Branches</bridgehead>
<para>Our development model is based on the git workflow originally presented by <ulink url="http://nvie.com/posts/a-successful-git-branching-model/">nvie</ulink>.
 We have a master branch which always reflects the current release, a development branch, stable branches for each major release, feature branches, and release branches.</para>
<para>All the procedures described below can also be performed via the <ulink url="https://github.com/nvie/gitflow">git-flow extension</ulink>.</para>
<para>Let us look at the branches in detail.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> The main branches</bridgehead>
<para>We have two main branches with an infinite lifetime.</para>
<itemizedlist mark="bullet" spacing="compact"><listitem>The branch develop always reflects the latest state in active development.
 New features are always integrated here.
</listitem>
<listitem>The master branch always matches the latest stable release, release tags are only created on the master branch.</listitem>
</itemizedlist><para> </para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> Feature branches</bridgehead>
<para>New features are developed in feature-branches (sometimes called topic branches).
 Feature branches typically have the prefix =feature/= and should always be branched off the development branch:</para>
<programlisting>$ git checkout -b feature/myFeature develop
</programlisting><para> Once the feature is done it should be merged back into the originating branch:</para>
<programlisting>$ git checkout develop
$ git merge --no-ff feature/myFeature
$ git branch -d feature/myFeature
</programlisting><para> The <computeroutput>--no-ff</computeroutput> flag causes the merge to always create a new commit object, even if the merge could be performed with a fast-forward.
 This avoids losing information about the historical existence of a feature branch and groups together all commits that together added the feature.</para>
<para> </para>
<bridgehead class="http://www.w3.org/1999/xhtml:h2"> Tagging a release</bridgehead>
<para>A minor release is created from a stable version branch like master.
 A release branch is created in which the rest of the release preparation like version bump, <ulink url="ChangeLog">ChangeLog</ulink> updates, and so on are done:</para>
<programlisting>$ git branch -b release/1.2.2 master
</programlisting><para> Once the branch is done it is merged back into master: </para>
<programlisting>$ git checkout branch master
$ git merge --no-ff release/1.2.2
</programlisting><para> It also has to be merged into the development branch (this might lead to conflicts which need to be resolved):</para>
<programlisting>$ git checkout develop
$ git merge --no-ff release/1.2.2
</programlisting><para> Then the release is tagged from master:</para>
<programlisting>$ git checkout master
$ git tag -s v/1.2.2
</programlisting><para> and finally the release branch can be removed:</para>
<programlisting>$ git branch -d release/1.2.2
</programlisting><para> </para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> Hotfix releases</bridgehead>
<para>Bug fixes that will go into a minor release (and as such are not considered a feature to be branched off the develop branch) need to be branched off the  master branch.</para>
<programlisting>$ git checkout -b hotfix/myFix master
</programlisting><para> Once the fix is done it is merged back into the master branch: </para>
<programlisting>$ git checkout master
$ git merge --no-ff hotfix/myFix
</programlisting><para> In case the fix also applies to the latest development version the branch has also to be merged into the develop branch before being deleted:</para>
<programlisting>$ git checkout develop
$ git merge --no-ff hotfix/myFix
$ git branch -d hotfix/myFix
</programlisting><bridgehead class="http://www.w3.org/1999/xhtml:h2">References</bridgehead>
<itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="http://virtuoso.openlinksw.com/dataspace/dav/wiki/Main/GitQuickstartTips">Git Quickstart &amp; Tips</ulink> [virtuoso.openlinksw.com] </listitem>
<listitem><ulink url="http://progit.org/book/">ProGit - Online-Book on Git Usage</ulink> </listitem>
<listitem><ulink url="http://help.github.com/">GitHub Help</ulink></listitem>
</itemizedlist></section></docbook>