« Previous - Version 8/11 (diff) - Next » - Current version
wolffy.au, 02/22/2012 22:14

GIT Branching Model

We follow the same branching model as ACE, based up http://nvie.com/git-model

If you are committing any code, ensure you NEVER commit directly to Master branch.


To clone a GIT repository:

git clone -b develop https://USERNAME:PASSWORD@git.dev-heaven.net/mso.git mso_test

Create a new branch (feature or release)

This will create a branch on your local copy and will not be pushed to DH repository. Very useful when used with REBASE if you are develop a new feature and don't want to affect other developers.

To create a new branch:

git branch feature-<name> OR git branch release-<version>

Change Log (releases)

To create a change log, make sure you're in the release branch:

git log --no-decorate --no-merges --format="%B" > temp.txt

Selective Merge back into Develop (hotfixes)

To cherry-pick merge your commits back into develop branch (right-click on commits):

git checkout develop
git push

Branch Merge back into Develop (features)

To merge your <branch> back into develop branch:

git stash save (optional)
git checkout develop
git rebase --no-ff <branch>
git push origin develop

Branch Merge back into Master (releases)

To merge a release branch to master post release:

git checkout master
git merge --no-ff release-<version> OR git merge --no-ff develop
git tag -a v<version>
git push --tags
git push

Delect Local Branch

To delete a local branch:

git branch -d <branch>

Delete Remote Branch

To delete a remote branch:

git push origin :<branch>

Rollback a Remote Commit

To rollback a remote commit:

git reset --hard <sha5>
git push -f origin <sha5>:<branch>