Skip to content
Stefan Profanter edited this page Sep 29, 2016 · 11 revisions

Git Workflow

The open62541 project uses the following Git Workflow:

  • There are different types of branches:
    • 0.2 current stable release branch. Everything that happens on this branch before release is also merged into master. After release, new development only happens on master, while bugfixes are cherry-picked into this branch. This is the default branch
    • master for development of new features not yet ready for stable-release
    • feature/description_of_feature new bigger features should always be pushed to a feature branch for review by other developers. When the feature is ready to be used by other developers, the feature branch is merged into master and then deleted.
    • hotfix/description_of_hotfix hotfixes which should be reviewed by other developers or merged into multiple branches (e.g. into master and stable release). When the hotfix is merged, the branch should be deleted

Git commits

  1. Use (local) branches when working on multiple features in parallel. Don't mix features/topics in fruit-salad commits.
  2. Set remote branches to git pull --rebase automatically using git config --global branch.autosetuprebase always. Individual branches can be set using git config branch.<branch>.rebase true. This prevents these additional "Merge branch 'master' of https://github.com/acplt/open62541" commits from being introduced.
  3. Use git add -p <filename> to select only those changes in files that are really required for the commit.
  4. Use git rebase -i <commit-hash> to interactively combine selected (local) commits into one commit. Especially apply cleanup fixes like "repair broken testing" silently before pushing. With git rebase -i HEAD~3 the scope is on the last 3 commits of the branch. Do this also before pushing a review request to master.
  5. Read popular best practices on the interwebs. Such as

Remove old doxygen versions

git checkout gh-pages
git reset $(git commit-tree HEAD^{tree} -m "squashing gh-pages to reduce repository size")
git push --force