Skip to content
andreav edited this page Aug 8, 2012 · 48 revisions

================================================

Note: Any branch can be used as integration branch, here we'll use master)


CREATING TOPIC BRANCHES

git intbr master                            (made only once)
git config 4f.ftrbr-prefix ftr/             (optional, and made only once)
git ftrbr-start mytopic

This command will:

  1. checkout master

  2. pull master

  3. create a branch named ftr/mytopic starting from master

create topic branch

Note: if integration branch is not tracked, pull will be skipped, resulting in an alias for

  git checkout -b ftr/mytopic master

INTEGRATING TOPIC BRANCHES

PLAIN INTEGRATE

git ftrbr-integrate

This command will:

  1. checkout master

  2. pull master

  3. merge ftr/mytopic into master

plain integrate

Note: if integration branch is not tracked, pull will be skipped, resulting in a shortcut for merging topicbranch into intbr

  git checkout -b master && git merge ftr/mytopic

Note: We can configure merge options by configuring 4f.ftrbr-integrate-merge-opt, i.e.:

  git config 4f.ftrbr-integrate-merge-opt --squash  (optional)

INTEGRATE WITH REBASE

git ftrbr-integrate-rebase

This command will:

  1. checkout master

  2. pull master

  3. rebase ftr/mytopic onto master

  4. merge ftr/mytopic into master (will fast forward)

integrate with rebase

Note: if integration branch is not tracked, pull will be skipped, resulting in a shortcut for rebasing topic branch onto intbr

  git rebase master && git checkout master && git merge ftr/mytopic

Note: We can configure merge options after rebase by configuring 4f.ftrbr-integrate-rebase-opt, i.e.:

  git config 4f.ftrbr-integrate-rebase-opt --no-ff  (optional)

integrate with rebase --noff

PUSHING TOPIC BRANCHES

PLAIN PUSH

git ftrbr-push

This command will:

  1. checkout master

  2. pull master

  3. merge ftr/mytopic into master

  4. push master to origin

push

Note: We can configure merge options by configuring 4f.ftrbr-integrate-merge-opt, i.e.:

  git config 4f.ftrbr-integrate-merge-opt --no-ff  (optional)

PUSH WITH REBASE

git ftrbr-push-rebase

This command will:

  1. checkout master

  2. pull master

  3. rebase ftr/mytopic onto master

  4. merge ftr/mytopic into master (will fast forward)

  5. push master to origin

push with rebase

Note: We can configure merge options by configuring 4f.ftrbr-integrate-rebase-opt

UPDATING TOPIC BRANCHES

PLAIN UPDATE

git ftrbr-update-merge

This command will:

  1. checkout master

  2. pull master

  3. checkout ftr/mytopic

  4. merge master into ftr/mytopic

update

Note: We can configure merge options by configuring 4f.ftrbr-update-merge-opt

UPDATE WITH REBASE

git ftrbr-update-rebase

This command will:

  1. checkout master

  2. pull master

  3. checkout ftr/mytopic

  4. rebase ftr/mytopic onto master

update with rebase

OTHER SCENARIOS

MULTIPLE parallel releases development

#make a topic on 1.0
git intbr 1.0-dev
git ftrbr-start topci-for-1.0
.. work on 1.0
git ftrbr-push

#make a topic on 2.0 - just change integration branch
git intbr 2.0-dev
git ftrbr-start topci-for-2.0
.. work on 2.0
git ftrbr-push-rebase

In this example, 1.0-dev and 2.0 dev are both open releases.

Developer select onto which one to work just changing integration branch.

Everything else is as usual.

SHARED TOPIC BRANCH

In this scenario a sub-team will work sharing a branch.

Someone will create shared branch and push it to origin. Then he/she will set it as integration branch, create a topic branch based on that shared branch:

  git intbr master    
  git ftrbr-start shared-br
  git push origin -u shared-br
  git intbr shared-br
  git ftrbr-start topic1
  ...
  git ftrbr-push-rebase

Another team member will import shared branch, track it, set it as integration branch and create his topic branch:

  git fetch
  git checkout -t origin/shared-br
  git intbr shared-br
  git ftrbr-start topic2
  ...
  git ftrbr-push-rebase

Please follow Customizations for knowing how to customize you workflow as you prefer