SlideShare a Scribd company logo
GIT Version Control
 davidx <mykingheaven@gmail.com>
about branch

A branch in Git is simply a lightweight
movable pointer to one of these commits.

“master” is the default branch
commands
git branch

git checkout

git reset

git merge

git rebase
git branch
git branch - list all branches locally

git branch -r - list all branches on the
remote side

git branch -d <XXX> - delete branch XXX

git branch -m <XXX> <YYY> - rename XXX to
YYY
git checkout

git checkout <BRANCH NAME> - switch to
that branch

git checkout -b <BRANCH NAME> - create a
new branch and switch to that branch
git reset
git reset --hard HEAD - give up all
uncommited changes

git reset --hard HEAD^ - back to the last
commit

ATTENTION: these changes are permanent,
you can not restore. Be careful.
git merge


git merge <BRANCH NAME> - merge changes
to the current branch
git rebase



git rebase <BRANCH NAME> - get changes
since master is changed
before rebase

          A -> B -> C -- branch
      /
D -> E -> F -- master
after rebase

               A -> B -> C -- branch
           /
D -> E -> F -- master
how we work

master branch is the root branch, you should
not develop under this branch

all feature development should under their
own branches

only when a feature is finished can it be
merged into develop branch

bug fix should have its own branch
example
initiate a repository

create a new branch: develop

create a new feature branch:feature1

merge feature1 into develop

create a new feature branch:feature2

merge feature2 into develop

merge develop into master and create a tag for it
when you fix a bug

create a new branch from develop: 512

fix your bug

switch to develop

merge branch 512

delete branch 512 - this step is optional
work with svn
I don’t use any plugins for it

always update svn in master branch

always commit svn in master branch

develop or fix bug in new git branch

merge into master branch

rebase other branches if master get updates
git flow


it’s a very successful git branch model

it have 2 important branches: master, develop

develop is the hot branch, all tests can be
done under this branch
feature
                                                    release branches
                       branches           develop                                hot xes   master




                                                                                                    Tag




Time
                                                                                                    0.1



                           Major                                   Severe bug
                         feature for                                  xed for
        Feature                                                    production:
                        next release
       for future                                                   hot x 0.2
        release

                                                    Incorporate
                                                      bug x in
                                                      develop


                                                                                                    Tag
                                                                                                    0.2



                                                                          Start of
                                                                          release
                                                                         branch for

                    From this point on,
                                                                            1.0
                       “next release”
                    means the release
                         after 1.0


                                                                           Only
                                                                         bug xes!




                                                    Bug xes from
                                                                                                    Tag
                                                     rel. branch
                                                       may be                                       1.0
                                                    continuously
                                                    merged back
                                                    into develop
Q&A

More Related Content

Similar to Git version control

Uber git workflow
Uber git workflowUber git workflow
Uber git workflow
Dmitry Petrov
 
Uber git workflow
Uber git workflowUber git workflow
Uber git workflow
Miroslav Genov
 
Uber git workflow
Uber git workflowUber git workflow
Uber git workflow
Glenn Roberts
 
Gitflow Workflow
Gitflow WorkflowGitflow Workflow
Gitflow Workflow
Hean Hong Leong
 
A Git Workflow Model or Branching Strategy
A Git Workflow Model or Branching StrategyA Git Workflow Model or Branching Strategy
A Git Workflow Model or Branching Strategy
Vivek Parihar
 
A successful Git branching model
A successful Git branching model A successful Git branching model
A successful Git branching model
abodeltae
 
Git workflows
Git workflowsGit workflows
Git workflows
Thuc Le Dong
 
Git flow Introduction
Git flow IntroductionGit flow Introduction
Git flow Introduction
David Paluy
 
GitFlow Workshop
GitFlow WorkshopGitFlow Workshop
GitFlow Workshop
Syed Imam
 
Source code management with Git
Source code management with GitSource code management with Git
Source code management with Git
Radu Barbu
 
Git flow workflow example
Git flow workflow exampleGit flow workflow example
Git flow workflow example
Samúel Jón Gunnarsson
 
Subversion
SubversionSubversion
Subversion
Tomy Ismail
 
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
 
Gitflow - Branching and Merging Flow for Git
Gitflow - Branching and Merging Flow for GitGitflow - Branching and Merging Flow for Git
Gitflow - Branching and Merging Flow for Git
Maulik Shah
 
Gitflow - Branching and Merging Flow for Git
Gitflow - Branching and Merging Flow for GitGitflow - Branching and Merging Flow for Git
Gitflow - Branching and Merging Flow for Git
Maulik Shah
 
Svn Basic Tutorial
Svn Basic TutorialSvn Basic Tutorial
Svn Basic Tutorial
Marco Pivetta
 
Hdfs high availability
Hdfs high availabilityHdfs high availability
Hdfs high availability
DataWorks Summit
 
Clarive 7 Branching Model
Clarive 7 Branching ModelClarive 7 Branching Model
Clarive 7 Branching Model
Clarive
 
Revisions
RevisionsRevisions
Revisions
swat_kh
 
Subversion to Git Migration
Subversion to Git MigrationSubversion to Git Migration
Subversion to Git Migration
Tim Massey
 

Similar to Git version control (20)

Uber git workflow
Uber git workflowUber git workflow
Uber git workflow
 
Uber git workflow
Uber git workflowUber git workflow
Uber git workflow
 
Uber git workflow
Uber git workflowUber git workflow
Uber git workflow
 
Gitflow Workflow
Gitflow WorkflowGitflow Workflow
Gitflow Workflow
 
A Git Workflow Model or Branching Strategy
A Git Workflow Model or Branching StrategyA Git Workflow Model or Branching Strategy
A Git Workflow Model or Branching Strategy
 
A successful Git branching model
A successful Git branching model A successful Git branching model
A successful Git branching model
 
Git workflows
Git workflowsGit workflows
Git workflows
 
Git flow Introduction
Git flow IntroductionGit flow Introduction
Git flow Introduction
 
GitFlow Workshop
GitFlow WorkshopGitFlow Workshop
GitFlow Workshop
 
Source code management with Git
Source code management with GitSource code management with Git
Source code management with Git
 
Git flow workflow example
Git flow workflow exampleGit flow workflow example
Git flow workflow example
 
Subversion
SubversionSubversion
Subversion
 
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
 
Gitflow - Branching and Merging Flow for Git
Gitflow - Branching and Merging Flow for GitGitflow - Branching and Merging Flow for Git
Gitflow - Branching and Merging Flow for Git
 
Gitflow - Branching and Merging Flow for Git
Gitflow - Branching and Merging Flow for GitGitflow - Branching and Merging Flow for Git
Gitflow - Branching and Merging Flow for Git
 
Svn Basic Tutorial
Svn Basic TutorialSvn Basic Tutorial
Svn Basic Tutorial
 
Hdfs high availability
Hdfs high availabilityHdfs high availability
Hdfs high availability
 
Clarive 7 Branching Model
Clarive 7 Branching ModelClarive 7 Branching Model
Clarive 7 Branching Model
 
Revisions
RevisionsRevisions
Revisions
 
Subversion to Git Migration
Subversion to Git MigrationSubversion to Git Migration
Subversion to Git Migration
 

Recently uploaded

Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Neo4j
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
DianaGray10
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
Neo4j
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
AstuteBusiness
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
DianaGray10
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
Edge AI and Vision Alliance
 
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
Edge AI and Vision Alliance
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Wask
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
Antonios Katsarakis
 

Recently uploaded (20)

Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
 
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
 

Git version control

  • 1. GIT Version Control davidx <mykingheaven@gmail.com>
  • 2. about branch A branch in Git is simply a lightweight movable pointer to one of these commits. “master” is the default branch
  • 3. commands git branch git checkout git reset git merge git rebase
  • 4. git branch git branch - list all branches locally git branch -r - list all branches on the remote side git branch -d <XXX> - delete branch XXX git branch -m <XXX> <YYY> - rename XXX to YYY
  • 5. git checkout git checkout <BRANCH NAME> - switch to that branch git checkout -b <BRANCH NAME> - create a new branch and switch to that branch
  • 6. git reset git reset --hard HEAD - give up all uncommited changes git reset --hard HEAD^ - back to the last commit ATTENTION: these changes are permanent, you can not restore. Be careful.
  • 7. git merge git merge <BRANCH NAME> - merge changes to the current branch
  • 8. git rebase git rebase <BRANCH NAME> - get changes since master is changed
  • 9. before rebase A -> B -> C -- branch / D -> E -> F -- master
  • 10. after rebase A -> B -> C -- branch / D -> E -> F -- master
  • 11. how we work master branch is the root branch, you should not develop under this branch all feature development should under their own branches only when a feature is finished can it be merged into develop branch bug fix should have its own branch
  • 12. example initiate a repository create a new branch: develop create a new feature branch:feature1 merge feature1 into develop create a new feature branch:feature2 merge feature2 into develop merge develop into master and create a tag for it
  • 13. when you fix a bug create a new branch from develop: 512 fix your bug switch to develop merge branch 512 delete branch 512 - this step is optional
  • 14. work with svn I don’t use any plugins for it always update svn in master branch always commit svn in master branch develop or fix bug in new git branch merge into master branch rebase other branches if master get updates
  • 15. git flow it’s a very successful git branch model it have 2 important branches: master, develop develop is the hot branch, all tests can be done under this branch
  • 16. feature release branches branches develop hot xes master Tag Time 0.1 Major Severe bug feature for xed for Feature production: next release for future hot x 0.2 release Incorporate bug x in develop Tag 0.2 Start of release branch for From this point on, 1.0 “next release” means the release after 1.0 Only bug xes! Bug xes from Tag rel. branch may be 1.0 continuously merged back into develop
  • 17. Q&A