git branch and git flow

26/12/2014

http://www.synbioz.com/blog/git-adopter-un-modele-de-versionnement-efficace

voir les branches:

git branch [-a]

créer une branche :

git branch develop # créer la branche
git checkout develop # aller sur la branche

NOUVELLE FONCTIONALITE

git checkout -b feature/foo develop # créer la branche et aller dessus
git commit -a -m "test"
git push

PUSH SUR DEVELOP

git checkout develop
git merge --no-ff feature/foo
git branch -d feature/foo
git push origin develop

PUSH SUR PROD

git checkout master
git merge --no-ff release/v1.2
git tag -a v1.2

push aussi sur dev la release

git checkout develop
git merge --no-ff release/v1.2
git branch -d release/v1.2.1

HOTFIX

git checkout -b hotfix/v1.2.1 master
git commit -a -m "Bumped version number to 1.2.1"
git commit -m "Fix huge production bug"
git checkout master
git merge --no-ff hotfix/v1.2.1

push aussi sur dev:

git checkout develop
git merge --no-ff hotfix/v1.2.1
git branch -d hotfix/v1.2.1
git flow init

NOUVELLE FONCTIONALITE

git flow feature start foo
git commit -am "fonctionalite"
git push
git flow feature finish foo

pour envoyer une feature

git flow feature publish foo

pour recupérer une feature

git flow feature pull origin foo

PUSH PROD

git flow release start v1.0.0
git commit -am "fonctionalite"
git push
git flow release finish v1.0.0

HOTFIX

git flow hotfix start typo
git flow hotfix finish typo