Git Workflow With Gitflow

15
Git Workflow with Gitflow

Transcript of Git Workflow With Gitflow

Page 1: Git Workflow With Gitflow

Git Workflow with Gitflow

Page 2: Git Workflow With Gitflow

What is a workflow?

"...consists of a sequence of connected steps.." - Wikipedia What are we looking? An way to multiple developers integrate a working code into a project

Page 3: Git Workflow With Gitflow

GitFlow

Page 4: Git Workflow With Gitflow

Why Gitflow?

■ Based on the graph you just saw.■ Github - https://github.com/nvie/gitflow■ Shortcuts for repetitive tasks.■ Branch naming convention "<prefix>/<name>"■ 2 main branches.

Page 5: Git Workflow With Gitflow

Main branches

1. master -> production-ready 2. develop -> latest for next release

Their lifetime is infinite.

Page 6: Git Workflow With Gitflow

Gitflow - prepare repository

$git flow init When creating a new git flow workflow it ask you questions about the names of the branches - USE DEFAULTS. when this is done a new develop branch is created from master and from this point you never commit to master branch anymore.

Page 7: Git Workflow With Gitflow
Page 8: Git Workflow With Gitflow

Gitflow - Supporting branches

There are 4 supporting branches:

1. feature2. release3. hotfix4. support

I will cover only feature since this is the only one you will work with.

Page 9: Git Workflow With Gitflow

Gitflow - Feature branches

● May branch off from: develop branch● Must merge back into: develop branch● Branch naming convention: anything except

master, develop, release/*, hotfix/* - our branching name will consist with 3base_<issue #>_<feature name>

● Typically exist in developer repos only, not in origin - from time to time I will ask to also push the specific branch also to origin.

Page 10: Git Workflow With Gitflow

Gitflow - Create feature branches

$git flow feature start 3base_<issue #>_<feature name> This is what it does: $git checkout -b feature/3base_<issue #>_<feature name> develop

Page 11: Git Workflow With Gitflow
Page 12: Git Workflow With Gitflow

Gitflow - finish feature branch● git flow feature finish <feature name>

$git checkout develop$git merge --no-ff myfeature - merges the branch to develop.$git branch -d myfeature - deletes the local branch$git push origin develop - push develop. The --no-ff flag avoids losing information about the historical existence of a feature

Page 13: Git Workflow With Gitflow
Page 14: Git Workflow With Gitflow
Page 15: Git Workflow With Gitflow

More on the subject

● gitflow on github -https://github.com/nvie/gitflow.● A successful git branching model● A short introduction to git-flow ● On the path with git-flow