SlideShare a Scribd company logo
1 of 14
GIT DEMO
Tingting Dong
tingdong@cisco.com
Agenda
• Why Git
• Git Repo
• Git Branch
• Rebase and Merge
• Common scenarios
• Q&A
Why Git
• Git is a free distributed version control
system
• Git can use in local
• Git is easy and fast to switch branch
Git Repo
• Workspace
– Include all physical files
• Index
– Save all temporary changes
• HEAD
– It’s a pointer, point to the latest commit in your
current branch
Git Repo
Branch management
a.file
b.file
a’.file
b.file
Integrate
Commit A
New branch
Commit B
Git rebase and Git merge
integrate
Feature branch
A1 A2
B1 B2 B3
Git merge
integrate
Feature branch
A1 A2
B1 B2 B3
B1 B2 B3
Git rebase
integrate
Feature branch
A1 A2
B1 B2 B3
Git rebase
integrate
Feature branch
A1 A2
B1 B2 B3
Git rebase
integrate
Feature branch
A1 A2
A1 A2
B1 B2 B3
Git rebase
integrate
Feature branch
A1 A2
A1 A2 B’1 B’2 B’3
Git rebase and Git merge
• Use rebase
– Your branch are local branch, No remote branch
• Use merge
– All other situations
QUESTIONS?

More Related Content

What's hot

Library Carpentry Git, GitHub and GitPages Introduction Slides
Library Carpentry Git, GitHub and GitPages Introduction SlidesLibrary Carpentry Git, GitHub and GitPages Introduction Slides
Library Carpentry Git, GitHub and GitPages Introduction SlidesSarah Anna Stewart
 
Icinga Camp New York 2018 - What's evolving in icinga 2018
Icinga Camp New York 2018 - What's evolving in icinga 2018Icinga Camp New York 2018 - What's evolving in icinga 2018
Icinga Camp New York 2018 - What's evolving in icinga 2018Icinga
 
Continuous Delivery in a content centric world
Continuous Delivery in a content centric worldContinuous Delivery in a content centric world
Continuous Delivery in a content centric worldJeroen Reijn
 
Icinga Camp New York 2018 - Opening
Icinga Camp New York 2018 - OpeningIcinga Camp New York 2018 - Opening
Icinga Camp New York 2018 - OpeningIcinga
 
What You Missed: OpenStack Summit Austin
What You Missed: OpenStack Summit AustinWhat You Missed: OpenStack Summit Austin
What You Missed: OpenStack Summit AustinNetApp
 
Automated code review process
Automated code review processAutomated code review process
Automated code review processSandesh Sharma
 
OSMC 2017 | Ops and dev stories- Integrate everything into your monitoring st...
OSMC 2017 | Ops and dev stories- Integrate everything into your monitoring st...OSMC 2017 | Ops and dev stories- Integrate everything into your monitoring st...
OSMC 2017 | Ops and dev stories- Integrate everything into your monitoring st...NETWAYS
 
Salesforce Flexible Pages
Salesforce Flexible PagesSalesforce Flexible Pages
Salesforce Flexible PagesSamuel De Rycke
 
Icinga Camp Berlin 2018 - Automated Monitoring of Proxmox VE with Icinga Dire...
Icinga Camp Berlin 2018 - Automated Monitoring of Proxmox VE with Icinga Dire...Icinga Camp Berlin 2018 - Automated Monitoring of Proxmox VE with Icinga Dire...
Icinga Camp Berlin 2018 - Automated Monitoring of Proxmox VE with Icinga Dire...Icinga
 
Icinga Camp Berlin 2018 - What's evolving in icinga 2018
Icinga Camp Berlin 2018 - What's evolving in icinga 2018Icinga Camp Berlin 2018 - What's evolving in icinga 2018
Icinga Camp Berlin 2018 - What's evolving in icinga 2018Icinga
 
Xtending nintex workflow cloud w azure functions - xchange conference
Xtending nintex workflow cloud w azure functions - xchange conferenceXtending nintex workflow cloud w azure functions - xchange conference
Xtending nintex workflow cloud w azure functions - xchange conferenceMichael Oryszak
 
OSMC 2017 | Icinga 2 Multi Zone HA Setup using Ansible by Toshaan Bharvani
OSMC 2017 | Icinga 2 Multi Zone HA Setup using Ansible by Toshaan BharvaniOSMC 2017 | Icinga 2 Multi Zone HA Setup using Ansible by Toshaan Bharvani
OSMC 2017 | Icinga 2 Multi Zone HA Setup using Ansible by Toshaan BharvaniNETWAYS
 
The Load Balancer: War Stories with HAProxy
The Load Balancer: War Stories with HAProxyThe Load Balancer: War Stories with HAProxy
The Load Balancer: War Stories with HAProxyGeoff Ballinger
 
Yannis Evangelou from lexiQA at BLU2017
Yannis Evangelou from lexiQA at BLU2017Yannis Evangelou from lexiQA at BLU2017
Yannis Evangelou from lexiQA at BLU2017Arseniy Konov
 

What's hot (17)

Atlassian Latest Updates
Atlassian Latest UpdatesAtlassian Latest Updates
Atlassian Latest Updates
 
Supervise your Akka actors
Supervise your Akka actorsSupervise your Akka actors
Supervise your Akka actors
 
Library Carpentry Git, GitHub and GitPages Introduction Slides
Library Carpentry Git, GitHub and GitPages Introduction SlidesLibrary Carpentry Git, GitHub and GitPages Introduction Slides
Library Carpentry Git, GitHub and GitPages Introduction Slides
 
Icinga Camp New York 2018 - What's evolving in icinga 2018
Icinga Camp New York 2018 - What's evolving in icinga 2018Icinga Camp New York 2018 - What's evolving in icinga 2018
Icinga Camp New York 2018 - What's evolving in icinga 2018
 
Continuous Delivery in a content centric world
Continuous Delivery in a content centric worldContinuous Delivery in a content centric world
Continuous Delivery in a content centric world
 
Icinga Camp New York 2018 - Opening
Icinga Camp New York 2018 - OpeningIcinga Camp New York 2018 - Opening
Icinga Camp New York 2018 - Opening
 
What You Missed: OpenStack Summit Austin
What You Missed: OpenStack Summit AustinWhat You Missed: OpenStack Summit Austin
What You Missed: OpenStack Summit Austin
 
Automated code review process
Automated code review processAutomated code review process
Automated code review process
 
OSMC 2017 | Ops and dev stories- Integrate everything into your monitoring st...
OSMC 2017 | Ops and dev stories- Integrate everything into your monitoring st...OSMC 2017 | Ops and dev stories- Integrate everything into your monitoring st...
OSMC 2017 | Ops and dev stories- Integrate everything into your monitoring st...
 
Salesforce Flexible Pages
Salesforce Flexible PagesSalesforce Flexible Pages
Salesforce Flexible Pages
 
Icinga Camp Berlin 2018 - Automated Monitoring of Proxmox VE with Icinga Dire...
Icinga Camp Berlin 2018 - Automated Monitoring of Proxmox VE with Icinga Dire...Icinga Camp Berlin 2018 - Automated Monitoring of Proxmox VE with Icinga Dire...
Icinga Camp Berlin 2018 - Automated Monitoring of Proxmox VE with Icinga Dire...
 
Icinga Camp Berlin 2018 - What's evolving in icinga 2018
Icinga Camp Berlin 2018 - What's evolving in icinga 2018Icinga Camp Berlin 2018 - What's evolving in icinga 2018
Icinga Camp Berlin 2018 - What's evolving in icinga 2018
 
Xtending nintex workflow cloud w azure functions - xchange conference
Xtending nintex workflow cloud w azure functions - xchange conferenceXtending nintex workflow cloud w azure functions - xchange conference
Xtending nintex workflow cloud w azure functions - xchange conference
 
OSMC 2017 | Icinga 2 Multi Zone HA Setup using Ansible by Toshaan Bharvani
OSMC 2017 | Icinga 2 Multi Zone HA Setup using Ansible by Toshaan BharvaniOSMC 2017 | Icinga 2 Multi Zone HA Setup using Ansible by Toshaan Bharvani
OSMC 2017 | Icinga 2 Multi Zone HA Setup using Ansible by Toshaan Bharvani
 
CATzure Azure Functions
CATzure Azure FunctionsCATzure Azure Functions
CATzure Azure Functions
 
The Load Balancer: War Stories with HAProxy
The Load Balancer: War Stories with HAProxyThe Load Balancer: War Stories with HAProxy
The Load Balancer: War Stories with HAProxy
 
Yannis Evangelou from lexiQA at BLU2017
Yannis Evangelou from lexiQA at BLU2017Yannis Evangelou from lexiQA at BLU2017
Yannis Evangelou from lexiQA at BLU2017
 

Viewers also liked

Viewers also liked (13)

Resultado de test estilos de aprendizaje
Resultado de test  estilos de aprendizajeResultado de test  estilos de aprendizaje
Resultado de test estilos de aprendizaje
 
Tips para abordar libros
Tips para abordar librosTips para abordar libros
Tips para abordar libros
 
Sumadhura Lake Breeze
Sumadhura Lake BreezeSumadhura Lake Breeze
Sumadhura Lake Breeze
 
Gerson P.P.P MUSICA
Gerson P.P.P MUSICAGerson P.P.P MUSICA
Gerson P.P.P MUSICA
 
Como primera tarea
Como primera tareaComo primera tarea
Como primera tarea
 
Professional Level Certificate
Professional Level CertificateProfessional Level Certificate
Professional Level Certificate
 
Digital access
Digital accessDigital access
Digital access
 
Carta de recomendación - MIUC
Carta de recomendación - MIUCCarta de recomendación - MIUC
Carta de recomendación - MIUC
 
Uso de recursos visuales en los trabajos recepcionales
Uso de recursos visuales en los trabajos recepcionalesUso de recursos visuales en los trabajos recepcionales
Uso de recursos visuales en los trabajos recepcionales
 
Iata codes
Iata codesIata codes
Iata codes
 
teknologi dan mediapembelajaran
teknologi dan mediapembelajaranteknologi dan mediapembelajaran
teknologi dan mediapembelajaran
 
Regions i,ii,iii and ncr
Regions i,ii,iii and ncrRegions i,ii,iii and ncr
Regions i,ii,iii and ncr
 
Photography and The Spiritual Exercises of St. Ignatius of Loyola
Photography and The Spiritual Exercises of St. Ignatius of LoyolaPhotography and The Spiritual Exercises of St. Ignatius of Loyola
Photography and The Spiritual Exercises of St. Ignatius of Loyola
 

Similar to git_demo

Learn Git - For Beginners and Intermediate levels
Learn Git - For Beginners and Intermediate levelsLearn Git - For Beginners and Intermediate levels
Learn Git - For Beginners and Intermediate levelsGorav Singal
 
Git Workflow
Git WorkflowGit Workflow
Git WorkflowGary Yeh
 
Version control git day02
Version control   git day02Version control   git day02
Version control git day02Gourav Varma
 
Essential git for developers
Essential git for developersEssential git for developers
Essential git for developersAidan Casey
 
Beginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitBeginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitRobert Lee-Cann
 
Git and GitHub workflows
Git and GitHub workflowsGit and GitHub workflows
Git and GitHub workflowsArthur Shvetsov
 
Data science Git management
Data science Git managementData science Git management
Data science Git managementArindam Banerjee
 
Introduction to Git for Network Engineers
Introduction to Git for Network EngineersIntroduction to Git for Network Engineers
Introduction to Git for Network EngineersJoel W. King
 
Version control git day03(amarnath dada)
Version control   git day03(amarnath dada)Version control   git day03(amarnath dada)
Version control git day03(amarnath dada)Gourav Varma
 

Similar to git_demo (20)

Introduction to git
Introduction to gitIntroduction to git
Introduction to git
 
Learn Git - For Beginners and Intermediate levels
Learn Git - For Beginners and Intermediate levelsLearn Git - For Beginners and Intermediate levels
Learn Git - For Beginners and Intermediate levels
 
Git Workflow
Git WorkflowGit Workflow
Git Workflow
 
Version control git day02
Version control   git day02Version control   git day02
Version control git day02
 
git Technologies
git Technologiesgit Technologies
git Technologies
 
Git with bitbucket
Git with bitbucketGit with bitbucket
Git with bitbucket
 
Essential git for developers
Essential git for developersEssential git for developers
Essential git for developers
 
Git tips and tricks
Git   tips and tricksGit   tips and tricks
Git tips and tricks
 
Talk to git
Talk to gitTalk to git
Talk to git
 
Beginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitBeginner's Guide to Version Control with Git
Beginner's Guide to Version Control with Git
 
Git - A soft introduction
Git - A soft introductionGit - A soft introduction
Git - A soft introduction
 
Git and GitHub workflows
Git and GitHub workflowsGit and GitHub workflows
Git and GitHub workflows
 
Data science Git management
Data science Git managementData science Git management
Data science Git management
 
Git at an Enterprise
Git at an EnterpriseGit at an Enterprise
Git at an Enterprise
 
Introduction to Git for Network Engineers
Introduction to Git for Network EngineersIntroduction to Git for Network Engineers
Introduction to Git for Network Engineers
 
Git tips
Git tipsGit tips
Git tips
 
Lets git to it
Lets git to itLets git to it
Lets git to it
 
3 Git
3 Git3 Git
3 Git
 
Git 101
Git 101Git 101
Git 101
 
Version control git day03(amarnath dada)
Version control   git day03(amarnath dada)Version control   git day03(amarnath dada)
Version control git day03(amarnath dada)
 

git_demo

Editor's Notes

  1. Svn 是集中式的,如果Svn 的服务器挂了,你重新搭个服务器版本信息就丢了, 但是Git不同,他的服务器是分布式的,如果我clone了git的repo,那我的电脑就可以做服务器了,保留了完整的版本信息 Svn 提交的时候必须要检查remote ,不提交不能继续别的工作,但是git 做commit的时候不需要网络 Svn的一个branch就是一个copy, 很占地方, 一会我们看看git的branch是怎么做的 Git 还有很多其他的优点, 就不一一介绍了
  2. Git repo 我们clone下来的就是一个完整的git repository Git repo 由三部分组成,git会负责自己维护这三部分 首先是workspace, 这里呢就是我们所有的物理文件,git clone的时候好几个g, 基本都是workspace的文件 然后index, 这个翻译成中文叫git的暂存区,所有修改并且做了git add的但是还没提交的文件都会放到git的暂存区 最后HEAD, 这是git维护的一个指针,他永远指向的是当前的branch的最新的commit号码,当你切换branch的时候, git会移动HEAD到新的branch的最新commit上面
  3. Git repo 由三部分组成,git会负责自己维护这三部分 首先是workspace, 这里呢就是我们所有的物理文件,git clone的时候好几个g, 基本都是workspace的文件 然后index, 这个翻译成中文叫git的暂存区,所有修改并且做了git add的但是还没提交的文件都会放到git的暂存区 最后HEAD, 这是git维护的一个指针,他永远指向的是当前的branch的最新的commit号码,当你切换branch的时候, git会移动HEAD到新的branch的最新commit上面
  4. Microsoft Confidential
  5. Microsoft Confidential
  6. Microsoft Confidential
  7. Microsoft Confidential
  8. Microsoft Confidential
  9. Microsoft Confidential
  10. Microsoft Confidential
  11. 那么这俩通常怎么用呢? 如果B是你的本地branch, 远程没有这个branch的话,推荐rebase, 然后再push到远程 如果B已经在远程了,并且B已经是个多人协作工作的branch了,那么强烈不推荐Rebase, 做merge就好,因为要保证你的修改不影响别人 到此,大家有啥问题没有?
  12. Microsoft Confidential