Skip to content

GIT development workflow

sm6yvr edited this page May 30, 2018 · 9 revisions

#Description This page will describe how we are working with development of new features, releases, bug fixing and also some git tips and trix.

Branches

master

No development work are made in master, we will merge the develop branch into master when it's time to do a new release.

release-X.Y

This branch is based on a main release tag in master (like 5.3) when we need to fix bugs for a specific release. New bug fixing releases will be tagged in this branch with X.Y.Z. We will not merge a bugfix release back into master. (TBD - How should we get bugfixes back into dev?)

develop

This is our main development branch where we receive pull-requests and are doing small improvements to the code base. When a feature branch is finished they will be merged into develop. When the development work are ready to be released the dev branch are merged into master.

feature/new_feature

When we are developing new features that should be done in a feature branch based on develop. When the feature are ready the branch will be merged into dev.

Workflow with LOCAL feature branch

Create a new feature branch

$ git checkout develop
$ git pull --rebase
$ git status # branch should be clean
$ git checkout -b feature/new-cool-feature
$ <add some commits with your feature

Fetch new changes from develop into your LOCAL feature branch

If you don't have pushed your feature branch to origin it is safe to rebase the feature branch from develop

$ git checkout feature/new-cool-feature
$ git rebase develop

Merge feature branch into develop

Your new feature are finished and commited into your feature branch

$ git checkout develop
$ git merge --squash feature/new-cool-feature
$ git add .
$ git commit -m "Merged new-cool-feature"

Delete your local feature branch

$ git branch -D feature/new-cool-feature

Workflow with PUBLIC feature branch

Create a new PUBLIC feature branch

$ git checkout develop
$ git pull --rebase
$ git status # branch should be clean
$ git checkout -b feature/new-cool-feature
$ <add some commits with your feature>
$ git push -u origin feature/new-cool-feature

Fetch new changes from develop into your PUCLIC feature branch

$ git checkout feature/new-cool-feature
$ git merge develop
$ git push origin feature/new-cool-feature

Merge feature branch into develop

Your new feature are finished and commited into your feature branch

$ git checkout develop

$ git merge --squash feature/new-cool-feature
$ git add .
$ git commit -m "Merged new-cool-feature"
$ git log --graph --all --decorate

Merge develop into master (when doing a release)

$ git checkout develop
$ git merge master
(resolve any merge conflicts if there are any)
$ git push origin develop
$ git checkout master
$ git merge --no-ff develop (there won't be any conflicts now)
$ git push origin master
You can’t perform that action at this time.