All page names need to be in English.
en da  de  fr  it  ja  km  nl  ru  zh

Branch (Git)

From TYPO3Wiki
Jump to: navigation, search

Most important branching commands

# list local branches
git branch -v

# list all (including remote) branches
git branch -av

# create a branch
git branch <branchname>

# checkout (switch to) branch
git checkout <branchname>

Branching model

Development (master) branch

The master branch corresponds to the former SVN trunk. Customarily, development occurs primarily on this branch.

  • Changes in branch master require a review in Gerrit before they are accepted.
  • Don't commit on branch master; fork off a topic branch from it.

Release (version) branches

Release branches are long living public branches that are maintained for a long time period, for example:

  • TYPO3_4-5
  • TYPO3_4-4
  • TYPO3_4-3
  • Release branches cant be changed without Gerrit review.
  • Don't commit on release branches; fork off a topic branch from them.

Topic branches

  • You should always work in a topic branch, also called feature branch.
  • A topic branch is a local branch that exists for the purpose of keeping changes in a descriptively named branch.

Things that you could consider for naming branches are the bugtracker reference, destination branch, and/or a meaningful description. Some examples:

(Using slashes you get grouping support in some GUI tools like gitx):

  • rfc/master/xyz
  • rfc/4-5/xyz
  • issue_xyz
  • feature_xyz
  • fixexception_xyz
  • improvelisting_xyz
  • port_xyz_4-6

Detached head

Detached head is a term that describes when your working directory does not belong to any branch; which happens when you checkout a specific commit. Useful for quick checkouts of a change request/RFC from Gerrit, which you can then turn either into a topic branch for later referral by git checkout -b <topic-branch> or fix by checking out a branch that you already created earlier by git checkout <topic-branch>