A Simple Git Workflow based on A successful Git branching model

Updated . Posted . Visible to the public.

I use TortoiseGit, with default options, ie, merge with ff.

Applicable for hot-fixes and small features.

Branch Naming

Prefix the branch name with the issue# then follow by a short subject, eg, 757_duplicate_order

Commit Message

Start the commit message with issue# in square bracket follow by more object name in square brackets, and then by verb in past tense, eg, [issue#757][order] Fixed duplicate orders.

Subflow 1 Inital commit

  1. Switch/Checkout master.
    This step is crucial. Make sure you are on the MASTER branch.
  2. Git Pull from remote
  3. Now, implement the hot-fixes and test in development until they are ready to commit
  4. Git Commit, select new branch and input a name say hotfix (chosen for brevity, please follow branch naming convention above)
  5. Select the files to commit and click OK

Subflow 2 When we are ready to test hotfix in staging:

  1. Switch/Checkout staging
  2. Git Pull from remote
  3. Git Merge from branch hotfix, default options, click OK
  4. Git Push staging to remote
  5. Predeploy staging in Jenkins. Go to Build History, Console Output and verify Changed Files.
  6. Deploy staging in Jenkins
  7. Test in staging

Subflow 3 Continue with more changes in hotfix:

  1. Switch/Checkout hotfix
  2. Git Commit to hotfix
  3. Go to subflow 2

Subflow 4 When we are ready to deploy to master:

  1. Switch/Checkout master
  2. Git Pull from remote
  3. Git Merge from branch hotfix, default options, click OK
  4. Git Push master to remote
  5. Predeploy master in Jenkins. Go to Build History, Console Output and verify Changed Files.
  6. Deploy master in Jenkins

After that, the branch hotfix can be deleted.

kiatng
Last edit
kiatng
Posted by kiatng to Git (2015-03-05 07:36)