SlideShare a Scribd company logo
Do you git your code?
Follow simplified Gitflow branching
model to improve productivity
By: Geshan Manandhar
HELLO!I am Geshan Manandhar
Senior software Engineer | QM Lead at Namshi.com
Tech Solution Provider
Agile follower and conditional microservices believer
@geshan - Geshan.com.np
What is this talk about
◉ Why Git and simplified git flow a.k.a github flow
◉ Prerequisites and assumptions
◉ The simplified gitflow/github flow steps
◉ Demo
◉ Things to consider
◉ Recap and Conclusion
Not using Git in
2016, Why?
Wrong tool for the job
Git is super popular
Git Usage in Nepal
Git is the most popular
VCS in Nepal
◉ 82.22% respondents of
a survey I did in 2015
said they used git.
◉ Survey: bit.ly/nep-dev-
survey
◉ Results as infographics
on my blog
Everyone in the team is
pushing to master,
Why?
When everyone pushes to master, someone will fall in a hole
Tell a story with your
commit/branch history.
Prerequisites
◉ You are aware of
◉ what git is
◉ what it is used for
◉ benefits of git
◉ You know about basic git commands like add, commit,
checkout etc
◉ Master is the stable branch which can be deployed anytime
Step 1: Start working in feature or bug fix - get a new branch
◉ Always follow a naming convention when you create a new
branch
◉ Like: HK-16 (where HK is short for project Hookah and 16 is the
ticket id from redmine/trello/Jira/Github Issue)
◉ Always get the latest master branch before you start any issue
◉ By typing: git checkout master && git fetch && git pull --
rebase origin master
◉ Then get a branch out of the latest master
◉ The command will be: git checkout -b HK-16
◉ Now you can start working on HK-16 - change readme
Step 2: Finished coding, let’s push now
◉ So you finished working on HK-16
◉ Then you do the following to commit the changes:
◉ git add . (explore git add -p)
◉ git add -u - if files have been deleted
◉ git commit - then write a commit message
◉ Keep in mind commit messages need to be meaningful
◉ You can do multiple logical commits.
◉ git push origin HK-16
Step 3: Pushed Code, now open a pull/merge request
◉ It is recommended that you squash your commits to one
◉ To open a merge/pull request, always get latest master then
rebase your current working branch
◉ Be in your branch git checkout HK-16, then execute: git
rebase master.
◉ As you just rebased with master, you may need to force push :
git push -f origin HK-16
◉ Browse to github/gitlab open a pull/merge request
◉ Move issue to right status in your project management
software if needed
Step 4: Team Lead/member reviews code and adds comments if needed
◉ Project Lead/Member should always check and review code
for each pull/merge request
◉ Code review is done to
◉ ensure coding standards
◉ coding and naming conventions
◉ any obvious bugs
◉ the solution quality is up to the standards
◉ code is maintainable on the long run.
◉ If there are comments, software engineer needs to fix them
◉ If the code matches standards, works and tests are passing :
deploy
Step 5: Code review ok, deploy to staging/production
◉ Always deploy to staging first and test it
◉ For staging, its ok to deploy the branch with your deployment
process
◉ If all (manual) tests are fine, then code is deployed to live.
◉ For live/productions, always create a tag and deploy the tag
◉ Given you are on HK-16 branch, execute git tag 1.6.25
◉ Then push the tag: git push origin 1.6.25 and deploy it live
Why is the tag named 1.6.25?
◉ Tags are basically pointers to a particular commit
◉ Naming depends on the version conventions.
◉ 1.6.25-p0 can mean 1st Year of operation, month of June, date
is 25 - p0 for second release of the day
◉ 1.44.3 can mean 1st Year of operation, week no. 44 and
release no 3, if you follow weekly sprints.
◉ If you use tags for staging you could suffix it with rc-1, rc for
release candidate
◉ Naming tags depends on how you want to do it
Step 6: Merge the tag to master when production/live is stable
◉ After testing and monitoring the live deployment, tag can be
merged to master
◉ To merge the tag to master, get the latest master
◉ On master branch run: git merge --no-ff 1.6.25
◉ All the changes that were deployed are in master right now
◉ This will automatically close the pull/merge request of the
branch
◉ You can deploy another branch after rebase and tagging it
◉ Next tag for the same day will be 1.6.25-p0
◉ Here p0 means patch 0 or 2nd deployment of the day
Why do a --no-ff on merge
◉ The --no-ff flag causes the merge to
always create a new commit object,
even if the merge could be performed
with a fast-forward.
◉ This avoids losing information about
the historical existence of a feature
branch and groups together all
commits that together added the
feature.
Difference between Gitflow and Simplified Gitflow
Basis Gitflow Simplified Gitflow
Perpetual
Branches
Has 3 perpetual branches:
master, release, develop
Has only 1 perpetual branch: master
(always stable, always deployable)
Complexity Higher: as Release needs to be
rebased with master and
develop. Conflicts can occur.
Lower: as there is only one perpetual
branch “master”, if all is good issues are
merged to master
Deployment
Atomicity
Multiple issues/tickets can be
deployed at a time. PRs merged
to release branch and tag
created from release to deploy.
Only one issue/ticket can be deployed at
a time. Atomic deployment helps in
testing and rollback is easier.
DEMOLet’s see how to do it
Things to consider
◉ Never force push on master
◉ You can force push on your branch provided others have not
branched out from your branch.
◉ For dependent issues, you can branch out of OP-10 then send
a merge/pull request to OP-10.
◉ Always align your branch from your source branch which is
generally master.
◉ Hot-fix can be done in the same way.
Simplified Gitflow/Github flow Recap
1. Start working in feature or bug fix - get a new branch
2. Finished coding, let’s push now
3. Pushed Code, now open a pull/merge request
4. Team Lead/member reviews code and adds comments if
needed
5. Code review ok, deploy to staging/production
6. Merge the tag to master when production/live is stable
7. You are a workhorse, work on the next issue
Conclusion
◉ Simplified Git flow is easier than it looks, with single ticket
atomic deployments
◉ Git flow encourages rigorous code reviews
◉ It helps to follow a standard procedure
◉ Rollbacks are easier as you know the last deployed live tag or
if tag is not merged it’s always safe to depl
THANKS!
Any questions?
You can find me at
@geshan - Geshan.com.np
◉ Looking for a job change? http://bit.ly/it-job-change-np
◉ This slide available at: http://bit.ly/s-gitflow
References
◉ http://vimeo.com/46010208 - Git Happens Video
◉ http://nvie.com/posts/a-successful-git-branching-model/ - Gitflow Brancing Model
◉ http://chris.beams.io/posts/git-commit/ - writing good commit message
◉ http://geshan.com.np/blog/2014/07/4-git-tips-beyond-basics/ - 4th Tip on Squashing git
commits
◉ http://geshan.com.np/blog/2016/04/3-simple-rules-for-less-or-no-git-conflicts/ - Be less
prone to git conflicts
◉ Images below:
◉ http://devopsreactions.tumblr.com/post/134848252538/when-the-backend-team-gets-
stuck-behind-schedule
◉ http://devopsreactions.tumblr.com/post/129836686205/wrong-tool-for-the-job
◉ https://unsplash.com/photos/G6G93jtU1vE
◉ https://www.flickr.com/photos/62244271@N03/8553590682/sizes/l
◉ https://pixabay.com/en/primate-ape-thinking-mimic-view-1019101/
Ad

More Related Content

What's hot (20)

Performance profiling and testing of symfony application 2
Performance profiling and testing of symfony application 2Performance profiling and testing of symfony application 2
Performance profiling and testing of symfony application 2
Andrew Yatsenko
 
Trunk-Based Development
Trunk-Based DevelopmentTrunk-Based Development
Trunk-Based Development
Bryan Liu
 
Git in Continuous Deployment
Git in Continuous DeploymentGit in Continuous Deployment
Git in Continuous Deployment
Brett Child
 
Code Quality Control in a PHP project. GeekTalks, Cherkassy 2020
Code Quality Control in a PHP project. GeekTalks, Cherkassy 2020Code Quality Control in a PHP project. GeekTalks, Cherkassy 2020
Code Quality Control in a PHP project. GeekTalks, Cherkassy 2020
Andrew Yatsenko
 
Intro to Git for Project Managers
Intro to Git for Project ManagersIntro to Git for Project Managers
Intro to Git for Project Managers
OyeLabs
 
Git workflows
Git workflowsGit workflows
Git workflows
Thuc Le Dong
 
Creating an api from design to security.
Creating an api from design to security.Creating an api from design to security.
Creating an api from design to security.
Roan Brasil Monteiro
 
Build Chef development box from scratch
Build Chef development box from scratchBuild Chef development box from scratch
Build Chef development box from scratch
Simone Soldateschi
 
[WroclawJUG] Continuous Delivery in OSS using Shipkit
[WroclawJUG] Continuous Delivery in OSS using Shipkit[WroclawJUG] Continuous Delivery in OSS using Shipkit
[WroclawJUG] Continuous Delivery in OSS using Shipkit
MarcinStachniuk
 
Continuous Delivery in OSS using Shipkit.org
Continuous Delivery in OSS using Shipkit.orgContinuous Delivery in OSS using Shipkit.org
Continuous Delivery in OSS using Shipkit.org
MarcinStachniuk
 
Git workflow in agile development
Git workflow in agile developmentGit workflow in agile development
Git workflow in agile development
Zack Siri
 
Git in 10 minutes (WordCamp Europe 2017)
Git in 10 minutes (WordCamp Europe 2017)Git in 10 minutes (WordCamp Europe 2017)
Git in 10 minutes (WordCamp Europe 2017)
Borek Bernard
 
PHPUnit with Magento
PHPUnit with MagentoPHPUnit with Magento
PHPUnit with Magento
Tu Hoang
 
GitLab webcast - Release 8.4
GitLab webcast - Release 8.4GitLab webcast - Release 8.4
GitLab webcast - Release 8.4
GitLab, Inc
 
Git flow
Git flowGit flow
Git flow
Valerio Como
 
GitLab 8.5 Highlights and Step-by-step tutorial
GitLab 8.5 Highlights and Step-by-step tutorialGitLab 8.5 Highlights and Step-by-step tutorial
GitLab 8.5 Highlights and Step-by-step tutorial
Heather McNamee
 
How to plan and define your CI-CD pipeline
How to plan and define your CI-CD pipelineHow to plan and define your CI-CD pipeline
How to plan and define your CI-CD pipeline
ElasTest Project
 
GitFlow Workshop
GitFlow WorkshopGitFlow Workshop
GitFlow Workshop
Syed Imam
 
如何透過 Golang 與 Heroku 來一鍵部署 臉書機器人與 Line Bot
如何透過 Golang 與 Heroku 來一鍵部署 臉書機器人與 Line Bot如何透過 Golang 與 Heroku 來一鍵部署 臉書機器人與 Line Bot
如何透過 Golang 與 Heroku 來一鍵部署 臉書機器人與 Line Bot
Evan Lin
 
Continuous delivery journey - Montgomery county JUG
Continuous delivery journey - Montgomery county JUGContinuous delivery journey - Montgomery county JUG
Continuous delivery journey - Montgomery county JUG
Raphaël Brugier
 
Performance profiling and testing of symfony application 2
Performance profiling and testing of symfony application 2Performance profiling and testing of symfony application 2
Performance profiling and testing of symfony application 2
Andrew Yatsenko
 
Trunk-Based Development
Trunk-Based DevelopmentTrunk-Based Development
Trunk-Based Development
Bryan Liu
 
Git in Continuous Deployment
Git in Continuous DeploymentGit in Continuous Deployment
Git in Continuous Deployment
Brett Child
 
Code Quality Control in a PHP project. GeekTalks, Cherkassy 2020
Code Quality Control in a PHP project. GeekTalks, Cherkassy 2020Code Quality Control in a PHP project. GeekTalks, Cherkassy 2020
Code Quality Control in a PHP project. GeekTalks, Cherkassy 2020
Andrew Yatsenko
 
Intro to Git for Project Managers
Intro to Git for Project ManagersIntro to Git for Project Managers
Intro to Git for Project Managers
OyeLabs
 
Creating an api from design to security.
Creating an api from design to security.Creating an api from design to security.
Creating an api from design to security.
Roan Brasil Monteiro
 
Build Chef development box from scratch
Build Chef development box from scratchBuild Chef development box from scratch
Build Chef development box from scratch
Simone Soldateschi
 
[WroclawJUG] Continuous Delivery in OSS using Shipkit
[WroclawJUG] Continuous Delivery in OSS using Shipkit[WroclawJUG] Continuous Delivery in OSS using Shipkit
[WroclawJUG] Continuous Delivery in OSS using Shipkit
MarcinStachniuk
 
Continuous Delivery in OSS using Shipkit.org
Continuous Delivery in OSS using Shipkit.orgContinuous Delivery in OSS using Shipkit.org
Continuous Delivery in OSS using Shipkit.org
MarcinStachniuk
 
Git workflow in agile development
Git workflow in agile developmentGit workflow in agile development
Git workflow in agile development
Zack Siri
 
Git in 10 minutes (WordCamp Europe 2017)
Git in 10 minutes (WordCamp Europe 2017)Git in 10 minutes (WordCamp Europe 2017)
Git in 10 minutes (WordCamp Europe 2017)
Borek Bernard
 
PHPUnit with Magento
PHPUnit with MagentoPHPUnit with Magento
PHPUnit with Magento
Tu Hoang
 
GitLab webcast - Release 8.4
GitLab webcast - Release 8.4GitLab webcast - Release 8.4
GitLab webcast - Release 8.4
GitLab, Inc
 
GitLab 8.5 Highlights and Step-by-step tutorial
GitLab 8.5 Highlights and Step-by-step tutorialGitLab 8.5 Highlights and Step-by-step tutorial
GitLab 8.5 Highlights and Step-by-step tutorial
Heather McNamee
 
How to plan and define your CI-CD pipeline
How to plan and define your CI-CD pipelineHow to plan and define your CI-CD pipeline
How to plan and define your CI-CD pipeline
ElasTest Project
 
GitFlow Workshop
GitFlow WorkshopGitFlow Workshop
GitFlow Workshop
Syed Imam
 
如何透過 Golang 與 Heroku 來一鍵部署 臉書機器人與 Line Bot
如何透過 Golang 與 Heroku 來一鍵部署 臉書機器人與 Line Bot如何透過 Golang 與 Heroku 來一鍵部署 臉書機器人與 Line Bot
如何透過 Golang 與 Heroku 來一鍵部署 臉書機器人與 Line Bot
Evan Lin
 
Continuous delivery journey - Montgomery county JUG
Continuous delivery journey - Montgomery county JUGContinuous delivery journey - Montgomery county JUG
Continuous delivery journey - Montgomery county JUG
Raphaël Brugier
 

Similar to Do You Git Your Code? Follow Simplified Gitflow Branching Model to Improve Productivity (20)

Git Series. Episode 3. Git Flow and Github-Flow
Git Series. Episode 3. Git Flow and Github-FlowGit Series. Episode 3. Git Flow and Github-Flow
Git Series. Episode 3. Git Flow and Github-Flow
Mikhail Melnik
 
A simplified Gitflow
A simplified GitflowA simplified Gitflow
A simplified Gitflow
Geshan Manandhar
 
Git best practices workshop
Git best practices workshopGit best practices workshop
Git best practices workshop
Otto Kekäläinen
 
Managing releases effectively through git
Managing releases effectively through gitManaging releases effectively through git
Managing releases effectively through git
Mohd Farid
 
Git 101: Force-sensitive to Jedi padawan
Git 101: Force-sensitive to Jedi padawanGit 101: Force-sensitive to Jedi padawan
Git 101: Force-sensitive to Jedi padawan
James Ford
 
Introducing Git and git flow
Introducing Git and git flow Introducing Git and git flow
Introducing Git and git flow
Sebin Benjamin
 
Introduction to git flow
Introduction to git flowIntroduction to git flow
Introduction to git flow
Knoldus Inc.
 
Git - Simplified For Testers
Git - Simplified For TestersGit - Simplified For Testers
Git - Simplified For Testers
upadhyay_25
 
Git and git workflow best practice
Git and git workflow best practiceGit and git workflow best practice
Git and git workflow best practice
Majid Hosseini
 
Git workshop
Git workshopGit workshop
Git workshop
Reslan Al Tinawi
 
Git & Code review
Git & Code reviewGit & Code review
Git & Code review
Cenk Gültekin
 
Git for work groups ironhack talk
Git for work groups ironhack talkGit for work groups ironhack talk
Git for work groups ironhack talk
Tiago Ameller
 
Collaborative development with git
Collaborative development with gitCollaborative development with git
Collaborative development with git
Joseluis Laso
 
Trunk based development for Beginners
Trunk based development for BeginnersTrunk based development for Beginners
Trunk based development for Beginners
Nebulaworks
 
Git sourcecontrolpreso
Git sourcecontrolpresoGit sourcecontrolpreso
Git sourcecontrolpreso
ColdFusionConference
 
Github
GithubGithub
Github
Sarah Eggleston
 
Introduction to Git (part 3)
Introduction to Git (part 3)Introduction to Git (part 3)
Introduction to Git (part 3)
Salvatore Cordiano
 
Switching to Git
Switching to GitSwitching to Git
Switching to Git
Stephen Yeargin
 
GitHub for Beginners - The Open-Source Gateaway
GitHub for Beginners - The Open-Source GateawayGitHub for Beginners - The Open-Source Gateaway
GitHub for Beginners - The Open-Source Gateaway
Md. Fahim Bin Amin
 
Bedjango talk about Git & GitHub
Bedjango talk about Git & GitHubBedjango talk about Git & GitHub
Bedjango talk about Git & GitHub
BeDjango
 
Git Series. Episode 3. Git Flow and Github-Flow
Git Series. Episode 3. Git Flow and Github-FlowGit Series. Episode 3. Git Flow and Github-Flow
Git Series. Episode 3. Git Flow and Github-Flow
Mikhail Melnik
 
Managing releases effectively through git
Managing releases effectively through gitManaging releases effectively through git
Managing releases effectively through git
Mohd Farid
 
Git 101: Force-sensitive to Jedi padawan
Git 101: Force-sensitive to Jedi padawanGit 101: Force-sensitive to Jedi padawan
Git 101: Force-sensitive to Jedi padawan
James Ford
 
Introducing Git and git flow
Introducing Git and git flow Introducing Git and git flow
Introducing Git and git flow
Sebin Benjamin
 
Introduction to git flow
Introduction to git flowIntroduction to git flow
Introduction to git flow
Knoldus Inc.
 
Git - Simplified For Testers
Git - Simplified For TestersGit - Simplified For Testers
Git - Simplified For Testers
upadhyay_25
 
Git and git workflow best practice
Git and git workflow best practiceGit and git workflow best practice
Git and git workflow best practice
Majid Hosseini
 
Git for work groups ironhack talk
Git for work groups ironhack talkGit for work groups ironhack talk
Git for work groups ironhack talk
Tiago Ameller
 
Collaborative development with git
Collaborative development with gitCollaborative development with git
Collaborative development with git
Joseluis Laso
 
Trunk based development for Beginners
Trunk based development for BeginnersTrunk based development for Beginners
Trunk based development for Beginners
Nebulaworks
 
GitHub for Beginners - The Open-Source Gateaway
GitHub for Beginners - The Open-Source GateawayGitHub for Beginners - The Open-Source Gateaway
GitHub for Beginners - The Open-Source Gateaway
Md. Fahim Bin Amin
 
Bedjango talk about Git & GitHub
Bedjango talk about Git & GitHubBedjango talk about Git & GitHub
Bedjango talk about Git & GitHub
BeDjango
 
Ad

More from Geshan Manandhar (20)

How to build an image to geo location guesser using Gemini 2 - Canberra.pdf
How to build an image to geo location guesser using Gemini 2 - Canberra.pdfHow to build an image to geo location guesser using Gemini 2 - Canberra.pdf
How to build an image to geo location guesser using Gemini 2 - Canberra.pdf
Geshan Manandhar
 
build-with-ai-sydney AI for web devs Tamas Piros
build-with-ai-sydney AI for web devs Tamas Pirosbuild-with-ai-sydney AI for web devs Tamas Piros
build-with-ai-sydney AI for web devs Tamas Piros
Geshan Manandhar
 
Are logs a software engineer’s best friend? Yes -- follow these best practices
Are logs a software engineer’s best friend? Yes -- follow these best practicesAre logs a software engineer’s best friend? Yes -- follow these best practices
Are logs a software engineer’s best friend? Yes -- follow these best practices
Geshan Manandhar
 
We lost $ 20.5K in one day and how we could have saved it… hint: better autom...
We lost $ 20.5K in one day and how we could have saved it… hint: better autom...We lost $ 20.5K in one day and how we could have saved it… hint: better autom...
We lost $ 20.5K in one day and how we could have saved it… hint: better autom...
Geshan Manandhar
 
Moving from A and B to 150 microservices, the journey, and learnings
Moving from A and B to 150 microservices, the journey, and learningsMoving from A and B to 150 microservices, the journey, and learnings
Moving from A and B to 150 microservices, the journey, and learnings
Geshan Manandhar
 
Adopt a painless continuous delivery culture, add more business value
Adopt a painless continuous delivery culture, add more business valueAdopt a painless continuous delivery culture, add more business value
Adopt a painless continuous delivery culture, add more business value
Geshan Manandhar
 
Things i wished i knew as a junior developer
Things i wished i knew as a junior developerThings i wished i knew as a junior developer
Things i wished i knew as a junior developer
Geshan Manandhar
 
Embrace chatops, stop installing deployment software - Laracon EU 2016
Embrace chatops, stop installing deployment software - Laracon EU 2016Embrace chatops, stop installing deployment software - Laracon EU 2016
Embrace chatops, stop installing deployment software - Laracon EU 2016
Geshan Manandhar
 
Embrace chatOps, stop installing deployment software
Embrace chatOps, stop installing deployment softwareEmbrace chatOps, stop installing deployment software
Embrace chatOps, stop installing deployment software
Geshan Manandhar
 
7 rules of simple and maintainable code
7 rules of simple and maintainable code7 rules of simple and maintainable code
7 rules of simple and maintainable code
Geshan Manandhar
 
Software engineering In Nepal mid 2015 part 01
Software engineering In Nepal mid 2015 part 01Software engineering In Nepal mid 2015 part 01
Software engineering In Nepal mid 2015 part 01
Geshan Manandhar
 
How to become a better software company technically
How to become a better software company technicallyHow to become a better software company technically
How to become a better software company technically
Geshan Manandhar
 
Things I wished I knew while doing my tech bachelor / undergraduate
Things I wished I knew while doing my tech bachelor / undergraduateThings I wished I knew while doing my tech bachelor / undergraduate
Things I wished I knew while doing my tech bachelor / undergraduate
Geshan Manandhar
 
Message Queues a basic overview
Message Queues a basic overviewMessage Queues a basic overview
Message Queues a basic overview
Geshan Manandhar
 
Most popular brands, people on facebook in nepal as of 2013 q4
Most popular brands, people on facebook in nepal as of 2013 q4Most popular brands, people on facebook in nepal as of 2013 q4
Most popular brands, people on facebook in nepal as of 2013 q4
Geshan Manandhar
 
Drupal 7 basic setup and contrib modules for a brochure website
Drupal 7 basic setup and contrib modules for a brochure websiteDrupal 7 basic setup and contrib modules for a brochure website
Drupal 7 basic setup and contrib modules for a brochure website
Geshan Manandhar
 
Git intro hands on windows with msysgit
Git intro hands on windows with msysgitGit intro hands on windows with msysgit
Git intro hands on windows with msysgit
Geshan Manandhar
 
Drupal 7 install with modules and themes
Drupal 7 install with modules and themesDrupal 7 install with modules and themes
Drupal 7 install with modules and themes
Geshan Manandhar
 
Drupal introduction
Drupal introductionDrupal introduction
Drupal introduction
Geshan Manandhar
 
No sql
No sqlNo sql
No sql
Geshan Manandhar
 
How to build an image to geo location guesser using Gemini 2 - Canberra.pdf
How to build an image to geo location guesser using Gemini 2 - Canberra.pdfHow to build an image to geo location guesser using Gemini 2 - Canberra.pdf
How to build an image to geo location guesser using Gemini 2 - Canberra.pdf
Geshan Manandhar
 
build-with-ai-sydney AI for web devs Tamas Piros
build-with-ai-sydney AI for web devs Tamas Pirosbuild-with-ai-sydney AI for web devs Tamas Piros
build-with-ai-sydney AI for web devs Tamas Piros
Geshan Manandhar
 
Are logs a software engineer’s best friend? Yes -- follow these best practices
Are logs a software engineer’s best friend? Yes -- follow these best practicesAre logs a software engineer’s best friend? Yes -- follow these best practices
Are logs a software engineer’s best friend? Yes -- follow these best practices
Geshan Manandhar
 
We lost $ 20.5K in one day and how we could have saved it… hint: better autom...
We lost $ 20.5K in one day and how we could have saved it… hint: better autom...We lost $ 20.5K in one day and how we could have saved it… hint: better autom...
We lost $ 20.5K in one day and how we could have saved it… hint: better autom...
Geshan Manandhar
 
Moving from A and B to 150 microservices, the journey, and learnings
Moving from A and B to 150 microservices, the journey, and learningsMoving from A and B to 150 microservices, the journey, and learnings
Moving from A and B to 150 microservices, the journey, and learnings
Geshan Manandhar
 
Adopt a painless continuous delivery culture, add more business value
Adopt a painless continuous delivery culture, add more business valueAdopt a painless continuous delivery culture, add more business value
Adopt a painless continuous delivery culture, add more business value
Geshan Manandhar
 
Things i wished i knew as a junior developer
Things i wished i knew as a junior developerThings i wished i knew as a junior developer
Things i wished i knew as a junior developer
Geshan Manandhar
 
Embrace chatops, stop installing deployment software - Laracon EU 2016
Embrace chatops, stop installing deployment software - Laracon EU 2016Embrace chatops, stop installing deployment software - Laracon EU 2016
Embrace chatops, stop installing deployment software - Laracon EU 2016
Geshan Manandhar
 
Embrace chatOps, stop installing deployment software
Embrace chatOps, stop installing deployment softwareEmbrace chatOps, stop installing deployment software
Embrace chatOps, stop installing deployment software
Geshan Manandhar
 
7 rules of simple and maintainable code
7 rules of simple and maintainable code7 rules of simple and maintainable code
7 rules of simple and maintainable code
Geshan Manandhar
 
Software engineering In Nepal mid 2015 part 01
Software engineering In Nepal mid 2015 part 01Software engineering In Nepal mid 2015 part 01
Software engineering In Nepal mid 2015 part 01
Geshan Manandhar
 
How to become a better software company technically
How to become a better software company technicallyHow to become a better software company technically
How to become a better software company technically
Geshan Manandhar
 
Things I wished I knew while doing my tech bachelor / undergraduate
Things I wished I knew while doing my tech bachelor / undergraduateThings I wished I knew while doing my tech bachelor / undergraduate
Things I wished I knew while doing my tech bachelor / undergraduate
Geshan Manandhar
 
Message Queues a basic overview
Message Queues a basic overviewMessage Queues a basic overview
Message Queues a basic overview
Geshan Manandhar
 
Most popular brands, people on facebook in nepal as of 2013 q4
Most popular brands, people on facebook in nepal as of 2013 q4Most popular brands, people on facebook in nepal as of 2013 q4
Most popular brands, people on facebook in nepal as of 2013 q4
Geshan Manandhar
 
Drupal 7 basic setup and contrib modules for a brochure website
Drupal 7 basic setup and contrib modules for a brochure websiteDrupal 7 basic setup and contrib modules for a brochure website
Drupal 7 basic setup and contrib modules for a brochure website
Geshan Manandhar
 
Git intro hands on windows with msysgit
Git intro hands on windows with msysgitGit intro hands on windows with msysgit
Git intro hands on windows with msysgit
Geshan Manandhar
 
Drupal 7 install with modules and themes
Drupal 7 install with modules and themesDrupal 7 install with modules and themes
Drupal 7 install with modules and themes
Geshan Manandhar
 
Ad

Recently uploaded (20)

Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
MINDCTI revenue release Quarter 1 2025 PR
MINDCTI revenue release Quarter 1 2025 PRMINDCTI revenue release Quarter 1 2025 PR
MINDCTI revenue release Quarter 1 2025 PR
MIND CTI
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
TrsLabs Consultants - DeFi, WEb3, Token Listing
TrsLabs Consultants - DeFi, WEb3, Token ListingTrsLabs Consultants - DeFi, WEb3, Token Listing
TrsLabs Consultants - DeFi, WEb3, Token Listing
Trs Labs
 
Web and Graphics Designing Training in Rajpura
Web and Graphics Designing Training in RajpuraWeb and Graphics Designing Training in Rajpura
Web and Graphics Designing Training in Rajpura
Erginous Technology
 
Top 10 IT Help Desk Outsourcing Services
Top 10 IT Help Desk Outsourcing ServicesTop 10 IT Help Desk Outsourcing Services
Top 10 IT Help Desk Outsourcing Services
Infrassist Technologies Pvt. Ltd.
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Vaibhav Gupta BAML: AI work flows without Hallucinations
Vaibhav Gupta BAML: AI work flows without HallucinationsVaibhav Gupta BAML: AI work flows without Hallucinations
Vaibhav Gupta BAML: AI work flows without Hallucinations
john409870
 
Are Cloud PBX Providers in India Reliable for Small Businesses (1).pdf
Are Cloud PBX Providers in India Reliable for Small Businesses (1).pdfAre Cloud PBX Providers in India Reliable for Small Businesses (1).pdf
Are Cloud PBX Providers in India Reliable for Small Businesses (1).pdf
Telecoms Supermarket
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
MINDCTI revenue release Quarter 1 2025 PR
MINDCTI revenue release Quarter 1 2025 PRMINDCTI revenue release Quarter 1 2025 PR
MINDCTI revenue release Quarter 1 2025 PR
MIND CTI
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
TrsLabs Consultants - DeFi, WEb3, Token Listing
TrsLabs Consultants - DeFi, WEb3, Token ListingTrsLabs Consultants - DeFi, WEb3, Token Listing
TrsLabs Consultants - DeFi, WEb3, Token Listing
Trs Labs
 
Web and Graphics Designing Training in Rajpura
Web and Graphics Designing Training in RajpuraWeb and Graphics Designing Training in Rajpura
Web and Graphics Designing Training in Rajpura
Erginous Technology
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Vaibhav Gupta BAML: AI work flows without Hallucinations
Vaibhav Gupta BAML: AI work flows without HallucinationsVaibhav Gupta BAML: AI work flows without Hallucinations
Vaibhav Gupta BAML: AI work flows without Hallucinations
john409870
 
Are Cloud PBX Providers in India Reliable for Small Businesses (1).pdf
Are Cloud PBX Providers in India Reliable for Small Businesses (1).pdfAre Cloud PBX Providers in India Reliable for Small Businesses (1).pdf
Are Cloud PBX Providers in India Reliable for Small Businesses (1).pdf
Telecoms Supermarket
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 

Do You Git Your Code? Follow Simplified Gitflow Branching Model to Improve Productivity

  • 1. Do you git your code? Follow simplified Gitflow branching model to improve productivity By: Geshan Manandhar
  • 2. HELLO!I am Geshan Manandhar Senior software Engineer | QM Lead at Namshi.com Tech Solution Provider Agile follower and conditional microservices believer @geshan - Geshan.com.np
  • 3. What is this talk about ◉ Why Git and simplified git flow a.k.a github flow ◉ Prerequisites and assumptions ◉ The simplified gitflow/github flow steps ◉ Demo ◉ Things to consider ◉ Recap and Conclusion
  • 4. Not using Git in 2016, Why?
  • 5. Wrong tool for the job
  • 6. Git is super popular
  • 7. Git Usage in Nepal Git is the most popular VCS in Nepal ◉ 82.22% respondents of a survey I did in 2015 said they used git. ◉ Survey: bit.ly/nep-dev- survey ◉ Results as infographics on my blog
  • 8. Everyone in the team is pushing to master, Why?
  • 9. When everyone pushes to master, someone will fall in a hole
  • 10. Tell a story with your commit/branch history.
  • 11. Prerequisites ◉ You are aware of ◉ what git is ◉ what it is used for ◉ benefits of git ◉ You know about basic git commands like add, commit, checkout etc ◉ Master is the stable branch which can be deployed anytime
  • 12. Step 1: Start working in feature or bug fix - get a new branch ◉ Always follow a naming convention when you create a new branch ◉ Like: HK-16 (where HK is short for project Hookah and 16 is the ticket id from redmine/trello/Jira/Github Issue) ◉ Always get the latest master branch before you start any issue ◉ By typing: git checkout master && git fetch && git pull -- rebase origin master ◉ Then get a branch out of the latest master ◉ The command will be: git checkout -b HK-16 ◉ Now you can start working on HK-16 - change readme
  • 13. Step 2: Finished coding, let’s push now ◉ So you finished working on HK-16 ◉ Then you do the following to commit the changes: ◉ git add . (explore git add -p) ◉ git add -u - if files have been deleted ◉ git commit - then write a commit message ◉ Keep in mind commit messages need to be meaningful ◉ You can do multiple logical commits. ◉ git push origin HK-16
  • 14. Step 3: Pushed Code, now open a pull/merge request ◉ It is recommended that you squash your commits to one ◉ To open a merge/pull request, always get latest master then rebase your current working branch ◉ Be in your branch git checkout HK-16, then execute: git rebase master. ◉ As you just rebased with master, you may need to force push : git push -f origin HK-16 ◉ Browse to github/gitlab open a pull/merge request ◉ Move issue to right status in your project management software if needed
  • 15. Step 4: Team Lead/member reviews code and adds comments if needed ◉ Project Lead/Member should always check and review code for each pull/merge request ◉ Code review is done to ◉ ensure coding standards ◉ coding and naming conventions ◉ any obvious bugs ◉ the solution quality is up to the standards ◉ code is maintainable on the long run. ◉ If there are comments, software engineer needs to fix them ◉ If the code matches standards, works and tests are passing : deploy
  • 16. Step 5: Code review ok, deploy to staging/production ◉ Always deploy to staging first and test it ◉ For staging, its ok to deploy the branch with your deployment process ◉ If all (manual) tests are fine, then code is deployed to live. ◉ For live/productions, always create a tag and deploy the tag ◉ Given you are on HK-16 branch, execute git tag 1.6.25 ◉ Then push the tag: git push origin 1.6.25 and deploy it live
  • 17. Why is the tag named 1.6.25? ◉ Tags are basically pointers to a particular commit ◉ Naming depends on the version conventions. ◉ 1.6.25-p0 can mean 1st Year of operation, month of June, date is 25 - p0 for second release of the day ◉ 1.44.3 can mean 1st Year of operation, week no. 44 and release no 3, if you follow weekly sprints. ◉ If you use tags for staging you could suffix it with rc-1, rc for release candidate ◉ Naming tags depends on how you want to do it
  • 18. Step 6: Merge the tag to master when production/live is stable ◉ After testing and monitoring the live deployment, tag can be merged to master ◉ To merge the tag to master, get the latest master ◉ On master branch run: git merge --no-ff 1.6.25 ◉ All the changes that were deployed are in master right now ◉ This will automatically close the pull/merge request of the branch ◉ You can deploy another branch after rebase and tagging it ◉ Next tag for the same day will be 1.6.25-p0 ◉ Here p0 means patch 0 or 2nd deployment of the day
  • 19. Why do a --no-ff on merge ◉ The --no-ff flag causes the merge to always create a new commit object, even if the merge could be performed with a fast-forward. ◉ This avoids losing information about the historical existence of a feature branch and groups together all commits that together added the feature.
  • 20. Difference between Gitflow and Simplified Gitflow Basis Gitflow Simplified Gitflow Perpetual Branches Has 3 perpetual branches: master, release, develop Has only 1 perpetual branch: master (always stable, always deployable) Complexity Higher: as Release needs to be rebased with master and develop. Conflicts can occur. Lower: as there is only one perpetual branch “master”, if all is good issues are merged to master Deployment Atomicity Multiple issues/tickets can be deployed at a time. PRs merged to release branch and tag created from release to deploy. Only one issue/ticket can be deployed at a time. Atomic deployment helps in testing and rollback is easier.
  • 22. Things to consider ◉ Never force push on master ◉ You can force push on your branch provided others have not branched out from your branch. ◉ For dependent issues, you can branch out of OP-10 then send a merge/pull request to OP-10. ◉ Always align your branch from your source branch which is generally master. ◉ Hot-fix can be done in the same way.
  • 23. Simplified Gitflow/Github flow Recap 1. Start working in feature or bug fix - get a new branch 2. Finished coding, let’s push now 3. Pushed Code, now open a pull/merge request 4. Team Lead/member reviews code and adds comments if needed 5. Code review ok, deploy to staging/production 6. Merge the tag to master when production/live is stable 7. You are a workhorse, work on the next issue
  • 24. Conclusion ◉ Simplified Git flow is easier than it looks, with single ticket atomic deployments ◉ Git flow encourages rigorous code reviews ◉ It helps to follow a standard procedure ◉ Rollbacks are easier as you know the last deployed live tag or if tag is not merged it’s always safe to depl
  • 25. THANKS! Any questions? You can find me at @geshan - Geshan.com.np ◉ Looking for a job change? http://bit.ly/it-job-change-np ◉ This slide available at: http://bit.ly/s-gitflow
  • 26. References ◉ http://vimeo.com/46010208 - Git Happens Video ◉ http://nvie.com/posts/a-successful-git-branching-model/ - Gitflow Brancing Model ◉ http://chris.beams.io/posts/git-commit/ - writing good commit message ◉ http://geshan.com.np/blog/2014/07/4-git-tips-beyond-basics/ - 4th Tip on Squashing git commits ◉ http://geshan.com.np/blog/2016/04/3-simple-rules-for-less-or-no-git-conflicts/ - Be less prone to git conflicts ◉ Images below: ◉ http://devopsreactions.tumblr.com/post/134848252538/when-the-backend-team-gets- stuck-behind-schedule ◉ http://devopsreactions.tumblr.com/post/129836686205/wrong-tool-for-the-job ◉ https://unsplash.com/photos/G6G93jtU1vE ◉ https://www.flickr.com/photos/62244271@N03/8553590682/sizes/l ◉ https://pixabay.com/en/primate-ape-thinking-mimic-view-1019101/