Git Branch Naming Conventions

From Littledamien Wiki
Jump to navigation Jump to search

Overview[edit]

Guidelines for Git branch naming conventions

Working Model[edit]

I am mostly basing this on the Stackoverflow article in the #Reference section below.

Project tracking system[edit]

For now, assuming that Trac is the project tracking software. Changes are logged as "tickets". Branches should incorporate the tracking id found in Track: "T" + tracking id, e.g. "T0010".

Git branch naming conventions[edit]

Break the Git branch name down to "GROUP/TRAC_TICKET_ID", i.e: "bug/T0010"

TODO: Come up with standard list of branch groups. These will correspond with Trac ticket types.

For now,

  • "bug" (Git) = "defect" (Trac)
  • "feature" = enhancement

Commit messages[edit]

$ git log --oneline --decorate

The above command will list all commit messages along with the active branches that they are associated with. If a branch has been deleted it will not be displayed with git log.

Therefore, when making commits it's best to lead with the branch name. While the branch is active the lines from git log will contain redundancies, but later on after a branch has been retired the commit message can be used to audit commits.

$ git log --oneline --decorate

Reference[edit]