SlideShare a Scribd company logo
Git and Git-Flow
M.M.H.Masud
Programmer at Granbury Solutions
mhasan@granburyrs.com
what we need for Git? (review)
1. Git installation in Windows
2. Git Installation in Linux & Mac
3. Git Bash for windows user
4. Terminal for Linux & Mac User
Git and Git-bash in Windows
Installation:
● Goto the link http://git-scm.com/download/win
● Install and follow the steps with default settings
● after installation open git-bash (start->All programs-
>git->Git Bash)
● Command line window will appear.
● type "git --version", it will show you the current git
version
Git and Git-bash in Windows
Git-Bash:
Git in Linux/Mac
1. Linux: type "sudo apt-get install git" in shell
2. Mac User: brew Install git
Git-Flow in windows
1. got to Git Bash
2. type "git clone --recursive git://github.com/nvie/gitflow.git"
3. now close git bash.
4. type "cmd" in start menu and then press Ctrl+shif+enter on Cmd
icon to open it in administrative mode.
5. goto git-flow directory like: C:gitflow
6. type "contrib/msysgit-install.cmd"
7. it will install git-flow
8. now open git bash again and type git-flow
9. you will see list of option for git-flow
10. all done. Ready to start with git-flow
Git-Flow in Linux/Mac
installing git-flow in Linux:
===========================
type "sudo apt-get install git-flow" and all done
installing git-flow in Mac:
===========================
brew install git-flow
Gitt and Git-flow
SSh Key add in Bitbucket
Windows:
- open git-bash
- Type “ssh-keygen -t rsa
"your_email@example.com"
- Follow the steps
- once generated, open the file: “cat ~/.
ssh/id_rsa.pub”
- copy the content
- add the key to bitbucket (manage
account -> ssh keys -> add key)
- Done.
Linux/Mac:
- open Terminal
- Type “ssh-keygen -t rsa
"your_email@example.com"
- Follow the steps
- once generated, open the file: “cat ~/.
ssh/id_rsa.pub”
- copy the content
- add the key to bitbucket (manage account
-> ssh keys -> add key)
- Done.
Git-Flow Init
Prerequisite
- a repository needs to be a git
repository
- master branch needs to be
available in Bitbucket and
local
Start Git-flow:
- “git-flow init” command needs to
be run
- it will create a ‘develop’ branch
from master branch.
- push the ‘develop’ branch to
bitbucket.
Ready to use Git-flow
Git-Flow Tools
SourceTree for Mac and Windows. (picture: SourceTree)
SmartSVN for Linux (non-commercial is free).
Git-Flow
Master Branch
Development
Branch
Feature Branch
TPOS-101
TPOS-101
TPOS-101
TPOS-101
Release Branch
release-v.1.0
release-v.2.0
Hotfix Branch
rel-1.0-hotfix-
TPOS-200
rel-1.0-hotfix-
TPOS-200
How Git-Flow Works
Git-Flow Feature
git-flow feature start TPOS-101
- start a branch from
development branch
git-flow feature finished TPOS-100
- merge the branch with
Development branch
git-flow feature finished -k TPOS-100
- -k : will not delete the branch
after finish.
git-flow feature publish TPOS-100
- push the branch to git
DEVELOPER
For any kind of JIRA ticket we will
create a Feature branch
Git-Flow Release
git-flow release start release-v.1.0
- start a branch from
development branch
git-flow release finished release-v.1.0
- merge the branch with
Development branch
- merge branch with master
branch
git-flow release finished -k release-v.
1.0
- -k : will not delete the branch
after finish.
git-flow release publish release-v.1.0
- push the branch to git
RELEASE MANAGER
If Release branch has bug?
1. check out release-v.1.0 in
local
2. create branch using GIT
(NOT git-flow) ex: rel-v.1.0-
TPOS-201
3. Fix the bug
4. Merge the branch with your
local release branch release-
v.1.0.
5. if ok, push the branch rel-v.
1.0-TPOS-201 in Bitbucket
Next:
- Create a Pull Request in
Bitbucket with release-v.1.0
Release v.1.0 Test done. Next???
1. Finish the Release v.1.0
2. it will merge release v.1.0
branch with local develop and
master branch.
3. check everything in local
4. Push both branch in
Bitbucket.
5. Tag the branch for future
reference (most important)
- check everything in Master
branch (http://staging.grspos.
net).
- If everything works fine, make
the release for production.
If Production has bug? :(
Production related bug fix is
commonly known as HOTFIX
and
GIT-FLOW manage it by himself
git-flow hotfix start rel-1.0-hotfix-
TPOS-301
- create branch from master
git-flow hotfix publish rel-1.0-hotfix-
TPOS-301
- push the branch in Bitbucket
git-flow hotfix finish rel-1.0-hotfix-
TPOS-301
- merge with develop
- merge with master
Hotfix Workflow
- Create hotfix branch using git-
flow
- publish the hotfix branch
using git-flow publish
- finish hotfix branch using git-
flow
- check everything in local
- once everything is working
fine, create two pull request to
develop & master branch
using bitbucket, like release
branch.
- Release master review pull
request, and merge it with
master and develop.
NOTE:
Don’t push Develop and master
branch from local after hotfix finish
Future & QA
- Create Git-Hook for Pre-
commit and POST-Commit
- Update Dev, Testing and
Staging server automatically
using bitbucket and git-hook
Ad

More Related Content

What's hot (20)

Introduction to git and github
Introduction to git and githubIntroduction to git and github
Introduction to git and github
Aderemi Dadepo
 
Bitbucket
BitbucketBitbucket
Bitbucket
Okba Mahdjoub
 
Git and GitHub workflows
Git and GitHub workflowsGit and GitHub workflows
Git and GitHub workflows
Arthur Shvetsov
 
Git and github fundamentals
Git and github fundamentalsGit and github fundamentals
Git and github fundamentals
RajKharvar
 
BitBucket presentation
BitBucket presentationBitBucket presentation
BitBucket presentation
Jonathan Lawerh
 
How we use Bitbucket to build Bitbucket
How we use Bitbucket to build BitbucketHow we use Bitbucket to build Bitbucket
How we use Bitbucket to build Bitbucket
Shunsuke (Sean) Osawa
 
Difference between gitlab vs github vs bitbucket
Difference between gitlab vs github vs bitbucketDifference between gitlab vs github vs bitbucket
Difference between gitlab vs github vs bitbucket
Acodez IT Solutions
 
HacktoberFest-Git&GitHub
HacktoberFest-Git&GitHubHacktoberFest-Git&GitHub
HacktoberFest-Git&GitHub
GDSCIIITBbsr
 
Git for beginners
Git for beginnersGit for beginners
Git for beginners
Arulmurugan Rajaraman
 
Workshop on Git and GitHub
Workshop on Git and GitHubWorkshop on Git and GitHub
Workshop on Git and GitHub
DSCVSSUT
 
GIT By Sivakrishna
GIT By SivakrishnaGIT By Sivakrishna
GIT By Sivakrishna
Nyros Technologies
 
Bitbucket
BitbucketBitbucket
Bitbucket
hariprasad1035
 
Introduction to GitHub
Introduction to GitHubIntroduction to GitHub
Introduction to GitHub
Nishan Bose
 
Git tutorial
Git tutorial Git tutorial
Git tutorial
TingYen Lee
 
How Git and Gerrit make you more productive
How Git and Gerrit make you more productiveHow Git and Gerrit make you more productive
How Git and Gerrit make you more productive
Karsten Dambekalns
 
Introduction to github slideshare
Introduction to github slideshareIntroduction to github slideshare
Introduction to github slideshare
Rakesh Sukumar
 
Git
GitGit
Git
Mayank Patel
 
Git Version Control System
Git Version Control SystemGit Version Control System
Git Version Control System
KMS Technology
 
Intro to Git & GitHub
Intro to Git & GitHubIntro to Git & GitHub
Intro to Git & GitHub
Google Developer Students Club NIT Silchar
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
Yan Vugenfirer
 

Similar to Gitt and Git-flow (20)

Git and git flow
Git and git flowGit and git flow
Git and git flow
Fran García
 
Mastering git - Workflow
Mastering git - WorkflowMastering git - Workflow
Mastering git - Workflow
Tahsin Abrar
 
Hello, Git!
Hello, Git!Hello, Git!
Hello, Git!
Shafiul Azam Chowdhury
 
Bitbucket git-bamboo-jira
Bitbucket git-bamboo-jiraBitbucket git-bamboo-jira
Bitbucket git-bamboo-jira
lenamattt
 
Gitflow
GitflowGitflow
Gitflow
Phuoc Bui
 
3DC Intro to Git Workshop
3DC Intro to Git Workshop3DC Intro to Git Workshop
3DC Intro to Git Workshop
BeckhamWee
 
Git flow workflow example
Git flow workflow exampleGit flow workflow example
Git flow workflow example
Samúel Jón Gunnarsson
 
Hello Git
Hello GitHello Git
Hello Git
bsadd
 
[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
 
Git and Github workshop
Git and Github workshopGit and Github workshop
Git and Github workshop
Otto Kekäläinen
 
Gitflow - Una metología para manejo de Branches
Gitflow - Una metología para manejo de BranchesGitflow - Una metología para manejo de Branches
Gitflow - Una metología para manejo de Branches
Javier Alvarez
 
Github and Git What the fuck is this shit .pdf
Github and Git What the fuck is this shit .pdfGithub and Git What the fuck is this shit .pdf
Github and Git What the fuck is this shit .pdf
krishna50blogging
 
Git development workflow
Git development workflowGit development workflow
Git development workflow
Sankar Suda
 
Vincit Teatime 2015.2 - Otto Kekäläinen: Don't be a git
Vincit Teatime 2015.2 - Otto Kekäläinen: Don't be a gitVincit Teatime 2015.2 - Otto Kekäläinen: Don't be a git
Vincit Teatime 2015.2 - Otto Kekäläinen: Don't be a git
VincitOy
 
Git essentials
Git essentialsGit essentials
Git essentials
Otto Kekäläinen
 
BLUG 2012 Version Control for Notes Developers
BLUG 2012 Version Control for Notes DevelopersBLUG 2012 Version Control for Notes Developers
BLUG 2012 Version Control for Notes Developers
Martin Jinoch
 
Git flow
Git flowGit flow
Git flow
Suraj Aair
 
Git.pptx
Git.pptxGit.pptx
Git.pptx
GDSC UofT Mississauga
 
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
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
Somkiat Puisungnoen
 
Mastering git - Workflow
Mastering git - WorkflowMastering git - Workflow
Mastering git - Workflow
Tahsin Abrar
 
Bitbucket git-bamboo-jira
Bitbucket git-bamboo-jiraBitbucket git-bamboo-jira
Bitbucket git-bamboo-jira
lenamattt
 
3DC Intro to Git Workshop
3DC Intro to Git Workshop3DC Intro to Git Workshop
3DC Intro to Git Workshop
BeckhamWee
 
Hello Git
Hello GitHello Git
Hello Git
bsadd
 
[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
 
Gitflow - Una metología para manejo de Branches
Gitflow - Una metología para manejo de BranchesGitflow - Una metología para manejo de Branches
Gitflow - Una metología para manejo de Branches
Javier Alvarez
 
Github and Git What the fuck is this shit .pdf
Github and Git What the fuck is this shit .pdfGithub and Git What the fuck is this shit .pdf
Github and Git What the fuck is this shit .pdf
krishna50blogging
 
Git development workflow
Git development workflowGit development workflow
Git development workflow
Sankar Suda
 
Vincit Teatime 2015.2 - Otto Kekäläinen: Don't be a git
Vincit Teatime 2015.2 - Otto Kekäläinen: Don't be a gitVincit Teatime 2015.2 - Otto Kekäläinen: Don't be a git
Vincit Teatime 2015.2 - Otto Kekäläinen: Don't be a git
VincitOy
 
BLUG 2012 Version Control for Notes Developers
BLUG 2012 Version Control for Notes DevelopersBLUG 2012 Version Control for Notes Developers
BLUG 2012 Version Control for Notes Developers
Martin Jinoch
 
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
 
Ad

Recently uploaded (20)

Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
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
 
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
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
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
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
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
 
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
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
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
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Ad

Gitt and Git-flow

  • 2. what we need for Git? (review) 1. Git installation in Windows 2. Git Installation in Linux & Mac 3. Git Bash for windows user 4. Terminal for Linux & Mac User
  • 3. Git and Git-bash in Windows Installation: ● Goto the link http://git-scm.com/download/win ● Install and follow the steps with default settings ● after installation open git-bash (start->All programs- >git->Git Bash) ● Command line window will appear. ● type "git --version", it will show you the current git version
  • 4. Git and Git-bash in Windows Git-Bash:
  • 5. Git in Linux/Mac 1. Linux: type "sudo apt-get install git" in shell 2. Mac User: brew Install git
  • 6. Git-Flow in windows 1. got to Git Bash 2. type "git clone --recursive git://github.com/nvie/gitflow.git" 3. now close git bash. 4. type "cmd" in start menu and then press Ctrl+shif+enter on Cmd icon to open it in administrative mode. 5. goto git-flow directory like: C:gitflow 6. type "contrib/msysgit-install.cmd" 7. it will install git-flow 8. now open git bash again and type git-flow 9. you will see list of option for git-flow 10. all done. Ready to start with git-flow
  • 7. Git-Flow in Linux/Mac installing git-flow in Linux: =========================== type "sudo apt-get install git-flow" and all done installing git-flow in Mac: =========================== brew install git-flow
  • 9. SSh Key add in Bitbucket Windows: - open git-bash - Type “ssh-keygen -t rsa "[email protected]" - Follow the steps - once generated, open the file: “cat ~/. ssh/id_rsa.pub” - copy the content - add the key to bitbucket (manage account -> ssh keys -> add key) - Done. Linux/Mac: - open Terminal - Type “ssh-keygen -t rsa "[email protected]" - Follow the steps - once generated, open the file: “cat ~/. ssh/id_rsa.pub” - copy the content - add the key to bitbucket (manage account -> ssh keys -> add key) - Done.
  • 10. Git-Flow Init Prerequisite - a repository needs to be a git repository - master branch needs to be available in Bitbucket and local Start Git-flow: - “git-flow init” command needs to be run - it will create a ‘develop’ branch from master branch. - push the ‘develop’ branch to bitbucket. Ready to use Git-flow
  • 11. Git-Flow Tools SourceTree for Mac and Windows. (picture: SourceTree) SmartSVN for Linux (non-commercial is free).
  • 12. Git-Flow Master Branch Development Branch Feature Branch TPOS-101 TPOS-101 TPOS-101 TPOS-101 Release Branch release-v.1.0 release-v.2.0 Hotfix Branch rel-1.0-hotfix- TPOS-200 rel-1.0-hotfix- TPOS-200
  • 14. Git-Flow Feature git-flow feature start TPOS-101 - start a branch from development branch git-flow feature finished TPOS-100 - merge the branch with Development branch git-flow feature finished -k TPOS-100 - -k : will not delete the branch after finish. git-flow feature publish TPOS-100 - push the branch to git DEVELOPER For any kind of JIRA ticket we will create a Feature branch
  • 15. Git-Flow Release git-flow release start release-v.1.0 - start a branch from development branch git-flow release finished release-v.1.0 - merge the branch with Development branch - merge branch with master branch git-flow release finished -k release-v. 1.0 - -k : will not delete the branch after finish. git-flow release publish release-v.1.0 - push the branch to git RELEASE MANAGER
  • 16. If Release branch has bug? 1. check out release-v.1.0 in local 2. create branch using GIT (NOT git-flow) ex: rel-v.1.0- TPOS-201 3. Fix the bug 4. Merge the branch with your local release branch release- v.1.0. 5. if ok, push the branch rel-v. 1.0-TPOS-201 in Bitbucket Next: - Create a Pull Request in Bitbucket with release-v.1.0
  • 17. Release v.1.0 Test done. Next??? 1. Finish the Release v.1.0 2. it will merge release v.1.0 branch with local develop and master branch. 3. check everything in local 4. Push both branch in Bitbucket. 5. Tag the branch for future reference (most important) - check everything in Master branch (http://staging.grspos. net). - If everything works fine, make the release for production.
  • 18. If Production has bug? :( Production related bug fix is commonly known as HOTFIX and GIT-FLOW manage it by himself git-flow hotfix start rel-1.0-hotfix- TPOS-301 - create branch from master git-flow hotfix publish rel-1.0-hotfix- TPOS-301 - push the branch in Bitbucket git-flow hotfix finish rel-1.0-hotfix- TPOS-301 - merge with develop - merge with master
  • 19. Hotfix Workflow - Create hotfix branch using git- flow - publish the hotfix branch using git-flow publish - finish hotfix branch using git- flow - check everything in local - once everything is working fine, create two pull request to develop & master branch using bitbucket, like release branch. - Release master review pull request, and merge it with master and develop. NOTE: Don’t push Develop and master branch from local after hotfix finish
  • 20. Future & QA - Create Git-Hook for Pre- commit and POST-Commit - Update Dev, Testing and Staging server automatically using bitbucket and git-hook