git basics, team workflows (ciro miranda)

27
Basics and Team Workflow

Upload: ciro-miranda

Post on 22-Jan-2018

333 views

Category:

Internet


5 download

TRANSCRIPT

Page 1: Git basics, Team Workflows (Ciro Miranda)

Basics and Team Workflow

Page 2: Git basics, Team Workflows (Ciro Miranda)

Version Control

Local version control with folders

Page 3: Git basics, Team Workflows (Ciro Miranda)

Version Control

Local version control with folders

Page 4: Git basics, Team Workflows (Ciro Miranda)

Local Version Control

Local version control central

repository

• Bad for collaboration

• Error prone

• Possibility to overwrite the wrong files

Page 5: Git basics, Team Workflows (Ciro Miranda)

Centralized Version Control

Centralized version control

• More control

• Better for sharing

• Better for collaboration,

but,

• Server is needed for every action

(commit, checkout, history)

• Single point of failure

Page 6: Git basics, Team Workflows (Ciro Miranda)

Distributed Version Control

Distributed version control

• Better for collaboration

• Every clone is a copy of the repository

• With the exception of pull and push, every

action is local!

• Very fast!

Page 7: Git basics, Team Workflows (Ciro Miranda)

Git

$ git clone <repo-url>

$ git status

$ git checkout -b new-stuff

< do some stuff (good and tested stuff) >

$ git add <files>

$ git status

$ git commit -m ‘My awesome development’

$ git pull

$ git push -u origin new-stuff

Page 8: Git basics, Team Workflows (Ciro Miranda)

Git - The Three States

source: http://git-scm.com/

Page 9: Git basics, Team Workflows (Ciro Miranda)

Git Branching

source: http://git-scm.com/

Storing data as changes to a base version of each file.

Page 10: Git basics, Team Workflows (Ciro Miranda)

Git Branching

source: http://git-scm.com/

Storing data as snapshots of the project over time.

Page 11: Git basics, Team Workflows (Ciro Miranda)

Git Branching

source: http://git-scm.com/

Page 12: Git basics, Team Workflows (Ciro Miranda)

Git Branching

source: http://git-scm.com/

Page 13: Git basics, Team Workflows (Ciro Miranda)

Git Branching

source: http://git-scm.com/

Page 14: Git basics, Team Workflows (Ciro Miranda)

Git Log

Page 15: Git basics, Team Workflows (Ciro Miranda)

Git Workflow - Working in teams

What is a workflow and how to define it?

There is more than one workflow:

• Centralized workflow

• Feature branch workflow

• Git Flow workflow

• Forking workflow

Page 16: Git basics, Team Workflows (Ciro Miranda)

Git Workflow - Working in teams

Parallel Development

Using feature branches isolates the development in progress from finished work.

Feature branch are used to develop new features that are integrated (merged)

only when done!

Page 17: Git basics, Team Workflows (Ciro Miranda)

Git Workflow - Working in teams

Release Staging Area

Complete work needs to be

integrated all together in one place.

There should be a specific branch

to do continuous integration,

validating every contribution to the

code base by building the

application and running tests.

Page 18: Git basics, Team Workflows (Ciro Miranda)

Git Workflow - Working in teams

Support For Emergency Fixes

Hotfixes should be easy to do not blocked by

current development. Hotfix branches should

only contain the code needed to solve the

issue.

Page 19: Git basics, Team Workflows (Ciro Miranda)

Git Workflow - Working in teams

Git Flow (Vincent Driesen)

Branches

• master (production ready)

• develop (integration)

• feature (new features)

• release (support release preparation)

• hotfix (quick production fix)

Page 20: Git basics, Team Workflows (Ciro Miranda)

Git Workflow - Working in teams

Infinite lifetime branches

Page 21: Git basics, Team Workflows (Ciro Miranda)

Git Workflow - Working in teams

Feature Branches

Page 22: Git basics, Team Workflows (Ciro Miranda)

Git Workflow - Working in teams

Release Branches

Page 23: Git basics, Team Workflows (Ciro Miranda)

Git Workflow - Working in teams

Hotfix Branches

Page 24: Git basics, Team Workflows (Ciro Miranda)

Pull request

Page 25: Git basics, Team Workflows (Ciro Miranda)

Pull request

Page 26: Git basics, Team Workflows (Ciro Miranda)

Where to find me

www.ciromiranda.pt

@ciromiranda

Page 27: Git basics, Team Workflows (Ciro Miranda)

Thank you

• https://guides.github.com/introduction/flow/

• https://www.atlassian.com/git/tutorials/compa

ring-workflows/

• https://try.github.io/levels/1/challenges/1

• http://git-scm.com/book/en/v2/

• http://nvie.com/posts/a-successful-git-

branching-model/

source: https://m.xkcd.com/1597/