SlideShare a Scribd company logo
1 of 26
Basic Principles of Git
Vo Huy Phuong
Basic Principles of Git
• What is Git
• Basic Operation with Git and How Git organize
data.
• What is Branch and basic operation with branch
• Repository and Remote Branch
What is Git
• What is Version Control System
– System that record the changes of a file or set of
file overtime.
• How many kind of Version Control system:
– Centralized Version Control System
– Distributed Version Control System
• Git and SourceTree
Centralize Version Controll System
Distributed Version Controll System
What is Git
• Git is distributed Version Control System
• Provide a rich, full command line for user to
manipulate data.
• SourceTree is application, provide a visual
interface for user to do with Git system.
Basic Operation and How Git organize
data
• Organize data into a three State:
– Git directory(repository)
– Working Directory
– Stage Area
How Git organize data
How Git organize data
• How Repository organize data
– Organize data into Tree
– Has many leafs(commit object) that link together
– Each commit has a snapshot of file/set of file that
changed
• An HEAD pointer to indicate the current status
we are on
• HEAD pointer will move forward if we commit
How Repository organize data
How Repository organize data
How Repository organize data
Basic Operation
• Some basic operation
– Git Add : add file to State area
– Git Checkout : reset the changed file in Working
area
– Git Reset : reset HEAD to specific commit
– Git Status : view the status of Working Area, and
State Area
Basic Operation
• Some basic operation
– Git rm : deleted a file from repository
– Git Commit: create the commit obj from the State
Area..and update Tree
– Git mv : move file from one location to another
location
– Git Log: show history in repository
What is Branch and basic Operation
with Branch
• Branch is one part of Git Tree
• Permit User to work independently with
another branch
• Branch is actually a movable pointer, that can
move forward or downward commit object in
Git Tree
How Repository organize data
What is Branch and basic Operation
with Branch
What is Branch and basic Operation
with Branch
• Basic Operation with branch
– Git checkout : create or change branch
– Git merge : merge one branch with another
branch
Basic Merge in Branch
Basic Merge in Branch
Basic Merge Conflict
Repository
• Basic Operation with repository
– Git fetch : Synchronize local database with server
database
– Git clone : create new local database and create
working copy for all file
Remote Branch
• Remote Brach is movable pointer that represent
the current status of this branch on server
• Git has difference pointer for one branch:1 for
remote branch and 1 for local branch
• Operation in Branch:
– Git merge : merge one branch with another branch
– Git pull : fetch one branch and merge local branch
with remote branch
– Git Push : push branch data to remote repository
Remote Branch
Remote Branch
Basic Principles in Git
• Reference : http://git-scm.com/book

More Related Content

What's hot (20)

Learning git
Learning gitLearning git
Learning git
 
Intro to git and git hub
Intro to git and git hubIntro to git and git hub
Intro to git and git hub
 
Git real slides
Git real slidesGit real slides
Git real slides
 
CICD Pipeline Using Github Actions
CICD Pipeline Using Github ActionsCICD Pipeline Using Github Actions
CICD Pipeline Using Github Actions
 
Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners
 
Git n git hub
Git n git hubGit n git hub
Git n git hub
 
Git commands
Git commandsGit commands
Git commands
 
Introducing GitLab (September 2018)
Introducing GitLab (September 2018)Introducing GitLab (September 2018)
Introducing GitLab (September 2018)
 
Git e GitHub
Git e GitHubGit e GitHub
Git e GitHub
 
Workshop git para iniciantes
Workshop git para iniciantesWorkshop git para iniciantes
Workshop git para iniciantes
 
Git and github 101
Git and github 101Git and github 101
Git and github 101
 
Git basic
Git basicGit basic
Git basic
 
Git training v10
Git training v10Git training v10
Git training v10
 
Git
GitGit
Git
 
GitHub Actions in action
GitHub Actions in actionGitHub Actions in action
GitHub Actions in action
 
Git 101 for Beginners
Git 101 for Beginners Git 101 for Beginners
Git 101 for Beginners
 
github-actions.pdf
github-actions.pdfgithub-actions.pdf
github-actions.pdf
 
git and github
git and githubgit and github
git and github
 
Git and Github Session
Git and Github SessionGit and Github Session
Git and Github Session
 
Git & GitHub WorkShop
Git & GitHub WorkShopGit & GitHub WorkShop
Git & GitHub WorkShop
 

Viewers also liked

Git-ing out of your git messes
Git-ing out of  your git messesGit-ing out of  your git messes
Git-ing out of your git messesKatie Sylor-Miller
 
Git基礎介紹
Git基礎介紹Git基礎介紹
Git基礎介紹Max Ma
 
Git 101 Presentation
Git 101 PresentationGit 101 Presentation
Git 101 PresentationScott Chacon
 
Docker, Linux Containers, and Security: Does It Add Up?
Docker, Linux Containers, and Security: Does It Add Up?Docker, Linux Containers, and Security: Does It Add Up?
Docker, Linux Containers, and Security: Does It Add Up?Jérôme Petazzoni
 
Getting Git Right
Getting Git RightGetting Git Right
Getting Git RightSven Peters
 
寫給大家的 Git 教學
寫給大家的 Git 教學寫給大家的 Git 教學
寫給大家的 Git 教學littlebtc
 
Ground improvement techniques
Ground improvement techniquesGround improvement techniques
Ground improvement techniquesSravan Muguda
 
Quick Introduction to git
Quick Introduction to gitQuick Introduction to git
Quick Introduction to gitJoel Krebs
 

Viewers also liked (14)

Git tutorial
Git tutorialGit tutorial
Git tutorial
 
Git-ing out of your git messes
Git-ing out of  your git messesGit-ing out of  your git messes
Git-ing out of your git messes
 
Git learning
Git learningGit learning
Git learning
 
Git基礎介紹
Git基礎介紹Git基礎介紹
Git基礎介紹
 
Git 101 Presentation
Git 101 PresentationGit 101 Presentation
Git 101 Presentation
 
Docker, Linux Containers, and Security: Does It Add Up?
Docker, Linux Containers, and Security: Does It Add Up?Docker, Linux Containers, and Security: Does It Add Up?
Docker, Linux Containers, and Security: Does It Add Up?
 
Git Tutorial 教學
Git Tutorial 教學Git Tutorial 教學
Git Tutorial 教學
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
 
Getting Git Right
Getting Git RightGetting Git Right
Getting Git Right
 
寫給大家的 Git 教學
寫給大家的 Git 教學寫給大家的 Git 教學
寫給大家的 Git 教學
 
Empire Fox Facts
Empire Fox FactsEmpire Fox Facts
Empire Fox Facts
 
Putting the t in team
Putting the t in teamPutting the t in team
Putting the t in team
 
Ground improvement techniques
Ground improvement techniquesGround improvement techniques
Ground improvement techniques
 
Quick Introduction to git
Quick Introduction to gitQuick Introduction to git
Quick Introduction to git
 

Similar to Git Fundamentals: Version Control, Branches & Merging

Similar to Git Fundamentals: Version Control, Branches & Merging (20)

GIT_training_SoftServeBulgaria2016
GIT_training_SoftServeBulgaria2016GIT_training_SoftServeBulgaria2016
GIT_training_SoftServeBulgaria2016
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
Git 101
Git 101Git 101
Git 101
 
GIT INTRODUCTION
GIT INTRODUCTIONGIT INTRODUCTION
GIT INTRODUCTION
 
GIT In Detail
GIT In DetailGIT In Detail
GIT In Detail
 
Git presentation to some coworkers some time ago
Git presentation to some coworkers some time agoGit presentation to some coworkers some time ago
Git presentation to some coworkers some time ago
 
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
 
Introduction to Git (part 1)
Introduction to Git (part 1)Introduction to Git (part 1)
Introduction to Git (part 1)
 
Git more done
Git more doneGit more done
Git more done
 
Git Series - Part 1
Git Series - Part 1 Git Series - Part 1
Git Series - Part 1
 
Learn Git Basics
Learn Git BasicsLearn Git Basics
Learn Git Basics
 
Git-Basics
Git-BasicsGit-Basics
Git-Basics
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Git 101
Git 101Git 101
Git 101
 
Git basics, Team Workflows (Ciro Miranda)
Git basics, Team Workflows (Ciro Miranda)Git basics, Team Workflows (Ciro Miranda)
Git basics, Team Workflows (Ciro Miranda)
 
Git in a nutshell
Git in a nutshellGit in a nutshell
Git in a nutshell
 
Lets git to it
Lets git to itLets git to it
Lets git to it
 
GIT.pptx
GIT.pptxGIT.pptx
GIT.pptx
 
Git Workflow
Git WorkflowGit Workflow
Git Workflow
 

Recently uploaded

Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfme23b1001
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncssuser2ae721
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...Chandu841456
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgUnit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgsaravananr517913
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptSAURABHKUMAR892774
 
lifi-technology with integration of IOT.pptx
lifi-technology with integration of IOT.pptxlifi-technology with integration of IOT.pptx
lifi-technology with integration of IOT.pptxsomshekarkn64
 
US Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionUS Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionMebane Rash
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
Class 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm SystemClass 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm Systemirfanmechengr
 
computer application and construction management
computer application and construction managementcomputer application and construction management
computer application and construction managementMariconPadriquez1
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleAlluxio, Inc.
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 

Recently uploaded (20)

Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdf
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgUnit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.ppt
 
lifi-technology with integration of IOT.pptx
lifi-technology with integration of IOT.pptxlifi-technology with integration of IOT.pptx
lifi-technology with integration of IOT.pptx
 
US Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionUS Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of Action
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
Class 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm SystemClass 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm System
 
computer application and construction management
computer application and construction managementcomputer application and construction management
computer application and construction management
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at Scale
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 

Git Fundamentals: Version Control, Branches & Merging

  • 1. Basic Principles of Git Vo Huy Phuong
  • 2. Basic Principles of Git • What is Git • Basic Operation with Git and How Git organize data. • What is Branch and basic operation with branch • Repository and Remote Branch
  • 3. What is Git • What is Version Control System – System that record the changes of a file or set of file overtime. • How many kind of Version Control system: – Centralized Version Control System – Distributed Version Control System • Git and SourceTree
  • 6. What is Git • Git is distributed Version Control System • Provide a rich, full command line for user to manipulate data. • SourceTree is application, provide a visual interface for user to do with Git system.
  • 7. Basic Operation and How Git organize data • Organize data into a three State: – Git directory(repository) – Working Directory – Stage Area
  • 9. How Git organize data • How Repository organize data – Organize data into Tree – Has many leafs(commit object) that link together – Each commit has a snapshot of file/set of file that changed • An HEAD pointer to indicate the current status we are on • HEAD pointer will move forward if we commit
  • 13. Basic Operation • Some basic operation – Git Add : add file to State area – Git Checkout : reset the changed file in Working area – Git Reset : reset HEAD to specific commit – Git Status : view the status of Working Area, and State Area
  • 14. Basic Operation • Some basic operation – Git rm : deleted a file from repository – Git Commit: create the commit obj from the State Area..and update Tree – Git mv : move file from one location to another location – Git Log: show history in repository
  • 15. What is Branch and basic Operation with Branch • Branch is one part of Git Tree • Permit User to work independently with another branch • Branch is actually a movable pointer, that can move forward or downward commit object in Git Tree
  • 17. What is Branch and basic Operation with Branch
  • 18. What is Branch and basic Operation with Branch • Basic Operation with branch – Git checkout : create or change branch – Git merge : merge one branch with another branch
  • 19. Basic Merge in Branch
  • 20. Basic Merge in Branch
  • 22. Repository • Basic Operation with repository – Git fetch : Synchronize local database with server database – Git clone : create new local database and create working copy for all file
  • 23. Remote Branch • Remote Brach is movable pointer that represent the current status of this branch on server • Git has difference pointer for one branch:1 for remote branch and 1 for local branch • Operation in Branch: – Git merge : merge one branch with another branch – Git pull : fetch one branch and merge local branch with remote branch – Git Push : push branch data to remote repository
  • 26. Basic Principles in Git • Reference : http://git-scm.com/book