Administrative

Projects

Active

Future

Finished

Reference

Abandoned

Project: Numbering

Git software development workflow

For a general introduction to the git version control system, the git book is a very good resource. This page documents how I use git to manage my software development cycle.

Branches

master

The master branch contains the currently released version of the code.

master is automatically created on repository creation.

develop

The develop branch is used to merge different dev_feature branches and prepare for the next release version.

After creation of the git repository and, if required, an initial checkin of existing code, the develop branch is created from master.

For release, develop is merged into master. It can be deleted when the project is finished and no more development activity is intended.

dev_feature

dev_feature branches, with feature being a placeholder for a feature or bugfix name, contain the actual development work for a single goal. When development on a dev_feature branch has produced a usable piece of software, the dev_feature branch can be merged into develop for propagation towards a release.

hotfix_bug

hotfix_bug branches, with bug being a placeholder for a descriptive tag, are used for development of fixes of urgent issues in release versions.

hotfix_bug branches are created from master.

When the hotfix has been written and tested, they are merged into master, ported to develop if necessary, and deleted.

Procedures

All procedures assume that all local repositories are updated before doing any work on non-local branches, and that any write operations on master are coordinated between developers.

Repository creation

Development

Release

Hotfix

F in the release tag is an incrementing decimal minor version number, counting hotfixes for this software release. It is not zero-padded.

Cheat sheet

Create a repo from scratch

On the server:

mkdir /srv/git/.../<dir>.git
cd !$
git --bare init --shared

In the local development directory

cd .../<dir>
git init
git add <file1> <file2> ...
git remote add origin <server alias>:<dir>
git commit -m 'initial checkin'
git push --set-upstream origin master

Create a new local branch and push it to server

git checkout -b devbranch
git push --set-upstream origin devbranch

Check out a specific remote branch

git checkout --track origin/dev-ha_stated

Delete a remote branch (on server)

git push origin --delete <branch name>

On every (other) local repo:

git remote prune origin

Suggested .gitignore

*~
*.1.gz
*.8.gz
*.cfg
*cscope*
*.dep
*.eep
*.elf
*.hex
*.log
*.lss
*.lst
*.map
*.o
obj
*.pyc
*.sym
# EAGLE
*.b#?
*.s#?
# Eclipse stuff follows...
/Debug
/Release
# PyCharm stuff follows...
.idea
# CMake
CMakeCache.txt
CMakeFiles
cmake_install.cmake
# 3d design
*.stl
*.gcode

Logbook

Last page update: 2015-11-29