GIT Workflow
Overview
We use the common git workflow, which means we have two major branches:
- Master: For stable and RPM deployment
- Dev: For development stuff
All Feature Requests are branched from Dev and merged to Dev.
Dev will only be merged to master (not backwards)!
Bugfixes are splitted into hot- and bugfixes. See below section.
For informations about the Versioning Schema click here.
Â
see: https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow
Bugfix vs Hotfix
Bugfix: not so important, will be merged to next released in normal schedule cycle of the software into dev (and then from dev to master)
Hotfix: important bug, branch from master - merge into master & dev, will be released soon / faster. Important security fixes, ...
Howto add a new branch
Example for a new feature branch
# move to dev git checkout dev git pull # git add local branch auto following/tracking remote branch git checkout -b feature/your-cool-feature-branch # your work and commits git add -p git commit -m "Commit Message XYZ" # git push auto to remote branch -> # see Git config global push.default = simple # NOTE: if not working – just follow git instructions git push
Useful GIT stuff
Push style
# push all branch names on local git to same names on remote git git config --global push.default simple
Enable server certificate on client
Trying to clone/fetch whatever a repo the git server ends with the error message
fatal: unable to access 'https://user@devel.roetzer-engineering.com:3128/stash/scm/pro/laravel.git/': Peer's certificate issuer has been marked as not trusted by the user.
To avoid this currently there is the following in ~/.gitconfig:
Â
[http] sslVerify = false
Â
which simply deactivates the certificate check.
The better (and safer) way is to download the server's certificate and make it known to git – therefore you can use the following script: enable_server_cert.sh
Don't forget to reset/delete the sslVerify statement in ~/.gitconfig
Useful log commands
# graphical illustration of branches git log --graph --full-history --all --pretty=format:'%Cred%h%Creset %ad %s %C(yellow)%d%Creset %C(bold blue)<%an>%Creset' --date=short git log --graph --oneline --decorate --all # example output * f1270f7 (HEAD, master) update README * 9af9d3b add a README * 694971d update phrase to hola world | * e3eb223 (mundo) add more tests | * 7cff591 add testing script | * c3ffff1 changed text to hello mundo |/ * b7dcc89 initial hello world code