Git Workflow » History » Revision 10

« Previous | Revision 10/21 (diff) | Next »
Alexander Watzinger, 2019-11-05 16:39

Git Workflow

We are using git as a versioning system using the Git Branching Workflows

Main branches

  • master - the stable version used in productive environments. It is the latest release version which is tested and, to our knowledge, bug-free.
  • develop - here the latest development branches are joined when they are finished. At a release the develop branch is merged into the master branch.

The branches in which the work (in progress) is happening have following prefixes:

  • feature_ - e.g. feature_user_profile_images
  • fix_ - e.g. fix_map_bug

When work on these branches is finished they are merged into the develop branch. Around once a month a new version is released where the develop branch is merged into the master branch.

When working on a new feature it's a good workflow to begin from the develop branch and merge it regularly to keep merge conflicts to a minimum.

Database changes

If there are database changes make sure that

  • there is a comment with the issue number at the SQL update script (e.g. at install/upgrade/3.12.0.sql)
  • that the issue is noted at util/

That way it's easier to deal with updates in the develop branch when dealing with multiple new features which need database updates.

Useful git configurations

These options can be configured in your global git config file e.g. ~/.gitconfig on Linux:

        name = Your Name
        email =
        ui = true
        editor = vim
        prune = true
        tool = meld
        keepBackup = false
        showUntrackedFiles = all

Or using shell commands e.g.

git config --global fetch.prune true

Prompt with branch and dirty

vim ~/.bashrc
function parse_git_dirty {
    [[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*" 
function parse_git_branch {
    git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/" 
PS1='\[\e[1;34m\]\u@\h:\w\[\e[0;32m\]$(parse_git_branch)\[\e[1;34m\]\$ \[\e[m\]'

Updated by Alexander Watzinger over 3 years ago · 10 revisions

Also available in: PDF HTML TXT