Maven Git Convention

This document describes how developers should use Git, our SCM.

Git migration

ETA of git migration is here: https://cwiki.apache.org/confluence/display/MAVEN/Git+Migration

Git Configuration

TODO

Commit Message Template

Commits should be focused on one issue at a time, because that makes it easier for others to review the commit.

A commit message should use this template:

[ISSUE-1] <<Summary field from JIRA>>
Submitted by: <<Name of non-committer>>

o Comments

Where:

  • ISSUE-1 can be omitted if there was no relevant JIRA issue, though you are strongly encouraged to create one for significant changes.
  • Submitted by only needs to be specified when a patch is being applied for a non-committer.
  • Comments some optional words about the solution.

eg:

[MNG-1456] Added the foo to the bar
Submitted by: Baz Bazman

o Applied without change

Apply User Patch

By default, the committer should apply the patch without any major modifications. In a second step, the committer could apply any changes as usual.

Edit Commit Message

 git commit --amend to edit last commit comment

Workflow

Workflow for svn folks is something like :

 $ git pull
 $ hack hack hack
 $ git push
 // fails, because someone else has already pushed to master
 $ git pull
 // this creates some merges
 $ git push

A more quiet workflow :

$ git pull
$ hack hack hack
$ git push
// fails, because someone else has already pushed to master
$ git fetch
// this moves 'origin/master'
$ git rebase origin/master
// this reapplies your local changes on top of origin/master
$ git push

Other useful Git commands while developing

If you've done a chunk of work and you would like ditch your changes and start from scratch use this command to revert to the original checkout:

$ git checkout .

TODO .gitignore