SlideShare a Scribd company logo
My Git WorkFlow
The GitHub Patterns

Rui Carvalho
@rhwy
The origin of the problem

How code lives

@rhwy // Rui Carvalho
lifecycle
New Features
New Features

Projects and
code evolve
with time

Bug Fix
In Production

Testing Next
Version

@rhwy // Rui Carvalho

Troubles !
Solutions ?

How people code

@rhwy // Rui Carvalho
Classic VCS Habits
•
•
•
•
•
•

Do a project “Long running” branch
Continue that ugly coding
Pray to be the first to merge
Deploy monthly to avoid conflicts
Iterate for X years (average 5?)
Big bang the project and create a new
VCS root

@rhwy // Rui Carvalho
Sounds good ?

@rhwy // Rui Carvalho
Should I care ?

Source Code

@rhwy // Rui Carvalho
Code Matters!
• Your code and your VCS are your only
valid documentation
• Your code is living and your VCS is the
open book of that History

@rhwy // Rui Carvalho
Keep calm and code

Rules

@rhwy // Rui Carvalho
Objectives ?
• Always be able to build a production
version
• Always be able to build a stable version
• Easily integrate new features
• Avoid long term “out of space” code (aka
project branches)
• Produce Value on each commit
@rhwy // Rui Carvalho
Simple model

git branch

@rhwy // Rui Carvalho
Small branches
•
•
•
•
•

Very small branches
Keep central repository clean
Work localy then push your branch
Someone else review & merge
Update your master

@rhwy // Rui Carvalho
Small branches
• No learning curve
• Near classic VCS patterns
– But, better isolation
– Easier, due to no-cost branching

• Work remotely
• No side effects

@rhwy // Rui Carvalho
Distant
merge

4

Project A
master

1

clone

Project A
Small_work

pull 5

push 3
6
rebase

Project A
master

2 branch

Local

Project A
Small_work
//2 step branching
$> git branch “create_login_box”
$> git checkout create_login_box

//1 command branching
$> git checkout –b create_login_box

Create Branch, then Checkout
$>
$>
$>
$>
$>

//add files, do some code
git add loginViewModel.cs
git commit –m “created view model for login”
//more core, finish
git commit –m “created html login UI”

//then push your branch with that commits
$> git push origin create_login_box

Code, Add to index, Commit, push branch
$> //on the remote repo
$> git checkout master
$> git create_login_box
$> //on your box, sync the master from remote
$> git pull origin master

Someone merge,
then you can update your local master
$>
it
$>
$>

//if you need to continue on the repo, sync
with the updated master
git checkout create_login_box
git rebase master

$> //if not delete it
$> git branch –d create_login_box

Then continue your work,
Or simply delete your branch
A better model

git fork

@rhwy // Rui Carvalho
Fork what?
•
•
•
•
•

Protect your central repository
Restrict rights, accept external work
Your branches, your mess
Your own builds, easier team work
Not git, but quite all online services
support it
– = clone on server side

@rhwy // Rui Carvalho
Other benefits
•
•
•
•

Easier remote work
YOU, sure to always have a clean master
Easier code review across teams
It opens a discussion

@rhwy // Rui Carvalho
Distant
1 Fork

Team Account
ProjectA repository
6

master

merge

Upstream

branch1

pull
Request
branch1
5

My Account
ProjectA repository

Origin
8
Push origin
master

2
clone
7
pull
Upstream
master

branch1

master

My Account

ProjectA repository
3

master

Local

branch

branch1

9
Rebase / delete

4
Push
Origin
branch1
$> //remotely:
$> //fork it/clone it on the server side from
company/projectA to myaccount/projectA
$> //locally:
$> git clone myrepo/projectA
$> git checkout –b my_feature

1. Fork, clone & branch
$> git add myfile
$> git commit –m “I added some value”
$> git push origin my_feature

2. Work, add, commit, push origin
$> //remotely:
$> //pull request : ask to push your branch
my_feature from myaccount/projectA to
company/projectA
$> //then merge on company/projectA
account(probably someone else)
$> //locally:
$> //update your master with the merged one
$> git pull upstream master

3.Pull request, merge, re-sync
$> //locally
$> //to be sure to always have a clean master
available everywher, you need to update it
$> git push origin master
$>
$>
$>
$>
$>
$>

//continue to work
git checkout my_feature
//sync your branch from updated master
git rebase master
//if not delete it
git branch –d create_login_box

Then, update your remote fork,
And continue your work,
Or simply delete your branch
Better code, more fun

Github workflow style

@rhwy // Rui Carvalho
Practice, practice, practice

Want to be a Ninja?

@rhwy // Rui Carvalho
Keep

In
touch

@rhwy
Codedistillers.com

rui.fr
github.com/rhwy

Octocats:
http://octodex.github.com/
A references:
http://nvie.com/posts/a-successful-git-branching-model/
https://github.com/NancyFx/Nancy/blob/master/CONTRIBUTING.md

More Related Content

PPTX
Git workflows
PDF
Git-flow workflow and pull-requests
PDF
Git flow Introduction
PPTX
Git flow
PDF
Git flow for daily use
PPTX
A successful Git branching model
PPTX
Why Aren't You Using Git Flow?
Git workflows
Git-flow workflow and pull-requests
Git flow Introduction
Git flow
Git flow for daily use
A successful Git branching model
Why Aren't You Using Git Flow?

What's hot (20)

PDF
Git Ready! Workflows
PPTX
Gitflow - Una metología para manejo de Branches
PDF
Pull Request (PR): A git workflow
PDF
Pubmi gitflow
PDF
Collaborative development with git
PDF
Gitflow Workflow
PPTX
Git development workflow
PDF
The gitflow way
PDF
Gitlab flow solo
PDF
Git introduction for Beginners
PPTX
Git in Continuous Deployment
PDF
Git Branching for Agile Teams
PDF
Git workflow in agile development
PPTX
Git and git workflow best practice
PDF
Serving Pull Requests with Jenkins
KEY
40 square's git workflow
PPTX
GitFlow Workshop
PDF
Bedjango talk about Git & GitHub
PDF
Composer and Git in Magento
PPTX
Git in 10 minutes (WordCamp Europe 2017)
Git Ready! Workflows
Gitflow - Una metología para manejo de Branches
Pull Request (PR): A git workflow
Pubmi gitflow
Collaborative development with git
Gitflow Workflow
Git development workflow
The gitflow way
Gitlab flow solo
Git introduction for Beginners
Git in Continuous Deployment
Git Branching for Agile Teams
Git workflow in agile development
Git and git workflow best practice
Serving Pull Requests with Jenkins
40 square's git workflow
GitFlow Workshop
Bedjango talk about Git & GitHub
Composer and Git in Magento
Git in 10 minutes (WordCamp Europe 2017)
Ad

Viewers also liked (20)

PPT
Git workflows
PDF
Git Branching Model
PDF
GitHub Talk - Cody Carnachan
PPTX
Using Git to Organize Your Project
PPTX
Introduction to git administration
PPT
Git workflows presentation
PPTX
The development workflow of git github for beginners
PDF
[2015/2016] Collaborative software development with Git
PPTX
PDF
Git and Github
KEY
Git and GitHub
PDF
Getting Git Right
PDF
Git and GitHub for Documentation
PDF
Git workflows
PDF
Git 101: Git and GitHub for Beginners
PDF
Introduction Pentaho 5.0
PDF
Samanage-Website-Redesign-Jan2017
PDF
Data meets Creativity - Webbdagarna 2015
PDF
BPM & Enterprise Middleware - Datasheet
PPTX
Challenges in opening up qualitative research data
Git workflows
Git Branching Model
GitHub Talk - Cody Carnachan
Using Git to Organize Your Project
Introduction to git administration
Git workflows presentation
The development workflow of git github for beginners
[2015/2016] Collaborative software development with Git
Git and Github
Git and GitHub
Getting Git Right
Git and GitHub for Documentation
Git workflows
Git 101: Git and GitHub for Beginners
Introduction Pentaho 5.0
Samanage-Website-Redesign-Jan2017
Data meets Creativity - Webbdagarna 2015
BPM & Enterprise Middleware - Datasheet
Challenges in opening up qualitative research data
Ad

Similar to My Git workflow (20)

PDF
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
PDF
.Git for WordPress Developers
PDF
Esri open source projects on GitHub
PDF
Switching to Git
PDF
Working with Git
PPT
Version Control ThinkVitamin
PPTX
PPT
version_control_lectures_for _git_all.ppt
PDF
[artifactconf] Github for People Who Don't Code
PDF
Hacking on WildFly 9
PPT
Open up your platform with Open Source and GitHub
PDF
Setting up Notifications, Alerts & Webhooks with Flux v2 by Alison Dowdney
PPTX
Working in Team using Git in Unity
PDF
Rails antipattern-public
PPTX
drupal ci cd concept cornel univercity.pptx
PPTX
Habitat Workshop at Velocity London 2017
PDF
Rails antipatterns
PDF
Hacking on WildFly 9
PDF
CICD_1670665418.pdf
PDF
Git for folk who like GUIs
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
.Git for WordPress Developers
Esri open source projects on GitHub
Switching to Git
Working with Git
Version Control ThinkVitamin
version_control_lectures_for _git_all.ppt
[artifactconf] Github for People Who Don't Code
Hacking on WildFly 9
Open up your platform with Open Source and GitHub
Setting up Notifications, Alerts & Webhooks with Flux v2 by Alison Dowdney
Working in Team using Git in Unity
Rails antipattern-public
drupal ci cd concept cornel univercity.pptx
Habitat Workshop at Velocity London 2017
Rails antipatterns
Hacking on WildFly 9
CICD_1670665418.pdf
Git for folk who like GUIs

More from Rui Carvalho (15)

PDF
Agile Feedback Loops
PDF
NewCrafts 2017 Conference Opening
PPTX
Cqrs Ignite
PDF
AltNet fr talks #2016.11 - news
PDF
Patience, the art of taking his time
PDF
Ncrafts 2016 opening notes
PDF
Code Cooking
PDF
Clean up your code with C#6
PDF
Feedback Loops v4x3 Lightening
PDF
Feedback Loops...to infinity, and beyond!
PDF
Simple Code
PDF
Simplicity 2.0 - Get the power back
PPTX
SPA avec Angular et SignalR (FR)
PPTX
Simplicity - develop modern web apps with tiny frameworks and tools
PPT
.Net pour le développeur Java - une source d'inspiration?
Agile Feedback Loops
NewCrafts 2017 Conference Opening
Cqrs Ignite
AltNet fr talks #2016.11 - news
Patience, the art of taking his time
Ncrafts 2016 opening notes
Code Cooking
Clean up your code with C#6
Feedback Loops v4x3 Lightening
Feedback Loops...to infinity, and beyond!
Simple Code
Simplicity 2.0 - Get the power back
SPA avec Angular et SignalR (FR)
Simplicity - develop modern web apps with tiny frameworks and tools
.Net pour le développeur Java - une source d'inspiration?

Recently uploaded (20)

PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Tartificialntelligence_presentation.pptx
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Empathic Computing: Creating Shared Understanding
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Spectroscopy.pptx food analysis technology
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Machine learning based COVID-19 study performance prediction
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
MIND Revenue Release Quarter 2 2025 Press Release
Dropbox Q2 2025 Financial Results & Investor Presentation
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Tartificialntelligence_presentation.pptx
MYSQL Presentation for SQL database connectivity
Spectral efficient network and resource selection model in 5G networks
Encapsulation_ Review paper, used for researhc scholars
Empathic Computing: Creating Shared Understanding
Accuracy of neural networks in brain wave diagnosis of schizophrenia
Mobile App Security Testing_ A Comprehensive Guide.pdf
Spectroscopy.pptx food analysis technology
Reach Out and Touch Someone: Haptics and Empathic Computing
Diabetes mellitus diagnosis method based random forest with bat algorithm
Machine learning based COVID-19 study performance prediction
Building Integrated photovoltaic BIPV_UPV.pdf
Programs and apps: productivity, graphics, security and other tools
Agricultural_Statistics_at_a_Glance_2022_0.pdf

My Git workflow

Editor's Notes

  • #2: This Talk is about common git workflows that most people use and targets people still using standard VCS (cvs, svn, tfs…) in their company.
  • #4: Code is living and at every moment, depending on the project size, the team size, the project age and many other factors, you need to have different “versions” of you code available