SlideShare a Scribd company logo
Git Tutorial | Git Basics - Branching, Merging, Rebasing | Learn Git | DevOps Tutorial | Edureka
Devops Certification Training www.edureka.co/devops
Topics For Today’s Session
Version Control System
Version Control System Types
Version Control Tools
Git Workflow
Parallel Development & Stashing
Hands-On
1
2
3
4
5
6
Copyright © 2018, edureka and/or its affiliates. All rights reserved.
Scenario From Company
Devops Certification Training www.edureka.co/devops
Scenario Of A Company
I hope client
likes this new
feature!
Devops Certification Training www.edureka.co/devops
Scenario Of A Company
Sure! I will
remove this
feature
I do not like it!
So please
remove this
feature
Devops Certification Training www.edureka.co/devops
Scenario Of A Company
But I have already
deleted that code! I
have to re write the
whole code again
Hey! I want
that feature
back!
Devops Certification Training www.edureka.co/devops
Once saved, all
changes are
permanent and
can’t be reverted
back.
Downtime may
occur due to
faulty updates,
since there is no
backup
maintained
No collaboration
between the
team. So no
records are
maintained.
Chaos Caused Without Version Control
Copyright © 2018, edureka and/or its affiliates. All rights reserved.
Version Control
Devops Certification Training www.edureka.co/devops
Version Control System
Version control is the
management of changes
to documents, computer
programs, large web sites,
and other collections of
information.
These changes are usually
termed as “versions”.
Copyright © 2018, edureka and/or its affiliates. All rights reserved.
Version Control Types
Devops Certification Training www.edureka.co/devops
Version Control Types
Distributed Version Control SystemCentralized Version Control System
Repository
Repository Repository Repository
Working Copy Working Copy Working Copy
Workstation/
PC #1
Workstation/
PC #2
Workstation/
PC #3
Commit
Update
Commit
Update
Commit
Update
Push
Pull
Server
Repository
Working Copy Working Copy Working Copy
Workstation/
PC #1
Workstation/
PC #2
Workstation/
PC #3
Server
Commit
Update
Devops Certification Training www.edureka.co/devops
Version Control System Tools
Version control has various tools like Git, Apache Subversion, Concurrent Version Systems, Team
Foundation Server, Mercurial etc.
Devops Certification Training www.edureka.co/devops
Released under GPL’s
license. It is for free and is
open source.
Why Git wins over other tools?
Economical Non -Linear Snapshots Distributed
Speed Robust Integrity Branching
Devops Certification Training www.edureka.co/devops
Released under GPL’s
license. It is for free and is
open source.
Supports non-linear
development of software.
Why Git wins over other tools?
Economical Non -Linear Snapshots Distributed
Speed Robust Integrity Branching
Devops Certification Training www.edureka.co/devops
Released under GPL’s
license. It is for free and is
open source.
Supports non-linear
development of software.
Records changes made to
a file rather than file itself.
Why Git wins over other tools?
Economical Non -Linear Snapshots Distributed
Speed Robust Integrity Branching
Devops Certification Training www.edureka.co/devops
Released under GPL’s
license. It is for free and is
open source.
Supports non-linear
development of software.
Records changes made to
a file rather than file itself.
Every user has his own
copy of the repository
data stored locally.
Why Git wins over other tools?
Economical Non -Linear Snapshots Distributed
Speed Robust Integrity Branching
Devops Certification Training www.edureka.co/devops
Released under GPL’s
license. It is for free and is
open source.
Supports non-linear
development of software.
Records changes made to
a file rather than file itself.
Every user has his own
copy of the repository
data stored locally.
Speed offered by Git is
lightening fast compared
to other VCS’s.
Why Git wins over other tools?
Economical Non -Linear Snapshots Distributed
Speed Robust Integrity Branching
Devops Certification Training www.edureka.co/devops
Released under GPL’s
license. It is for free and is
open source.
Supports non-linear
development of software.
Records changes made to
a file rather than file itself.
Every user has his own
copy of the repository
data stored locally.
Speed offered by Git is
lightening fast compared
to other VCS’s.
Why Git wins over other tools?
Nearly every task in Git is
undo-able.
Economical Non -Linear Snapshots Distributed
Speed Robust Integrity Branching
Devops Certification Training www.edureka.co/devops
Released under GPL’s
license. It is for free and is
open source.
Supports non-linear
development of software.
Records changes made to
a file rather than file itself.
Every user has his own
copy of the repository
data stored locally.
Speed offered by Git is
lightening fast compared
to other VCS’s.
No changes can be made
without Git recording it.
Why Git wins over other tools?
Nearly every task in Git is
undo-able.
Economical Non -Linear Snapshots Distributed
Speed Robust Integrity Branching
Devops Certification Training www.edureka.co/devops
Released under GPL’s
license. It is for free and is
open source.
Supports non-linear
development of software.
Records changes made to
a file rather than file itself.
Every user has his own
copy of the repository
data stored locally.
Speed offered by Git is
lightening fast compared
to other VCS’s.
No changes can be made
without Git recording it.
Why Git wins over other tools?
Nearly every task in Git is
undo-able.
Every collaborator’s
working directory is in
itself a branch.
Economical Non -Linear Snapshots Distributed
Speed Robust Integrity Branching
Devops Certification Training www.edureka.co/devops
Released under GPL’s
license. It is for free and is
open source.
Supports non-linear
development of software.
Records changes made to
a file rather than file itself.
Every user has his own
copy of the repository
data stored locally.
Speed offered by Git is
lightening fast compared
to other VCS’s.
No changes can be made
without Git recording it.
Why Git wins over other tools?
Nearly every task in Git is
undo-able.
Every collaborator’s
working directory is in
itself a branch.
Economical Non -Linear Snapshots Distributed
Speed Robust Integrity Branching
Devops Certification Training www.edureka.co/devops
What is Git?
Git is an open source Distributed Version Control System(DVCS) which records changes made to
the files laying emphasis on speed, data integrity and distributed, non-linear workflows
Devops Certification Training www.edureka.co/devops
Workflow of Git
Devops Certification Training www.edureka.co/devops
Workflow Of Git
Copyright © 2018, edureka and/or its affiliates. All rights reserved.
Parallel Development
Devops Certification Training www.edureka.co/devops
Branching
Branching is an integral part of any Version Control(VC) System. Unlike other VC’s Git does not
create a copy of existing files for new branch. It points to snapshot of the changes you have
made in the system
Devops Certification Training www.edureka.co/devops
Merging
Merging integrates the changes made in different branches into one single branch
Devops Certification Training www.edureka.co/devops
Rebasing
Used when changes made in one branch needs to be reflected in another branch
Copyright © 2018, edureka and/or its affiliates. All rights reserved.
Stashing
Devops Certification Training www.edureka.co/devops
Stashing
Used when changes made in one branch needs to be reflected in another branch
Copyright © 2018, edureka and/or its affiliates. All rights reserved.
Hands-On
Devops Certification Training www.edureka.co/devops
Hands-On – Problem Statement
Company want a better
Source Code Management
System because the earlier
tool had the tendency to save
redundant code. Multiple
Developers working
simultaneously on same block
of code also caused problems.
Devops Certification Training www.edureka.co/devops
Hands-On – Solution
Task is to move the
company’s code base to
git and Github.
Devops Certification Training www.edureka.co/devops
Git Commands
Basic Commands
sudo apt-get install git git config --global user.name “username”
git initgit add <filename> git status git commit git diff
git rm <filename>
git rm --cached <filename>
git rm -f <filename>
git log
git tag --a <annotation> --m <message>
git add remote origin <remote link>
git tag
git show <tag-name>
git push origin master
git push origin --tags
git pull origin
git fetch origin
Devops Certification Training www.edureka.co/devops
Git Commands
git stash pop
git stash save ‘message’ git stash list git stash apply <stash id>
git stash drop <stack id> git stash clear
Stashing Commands
Branching Commands
git branch <branchname> git checkout <branchname>
git branch -D <branchname>git branch -d <branchname>
git merge <branchname>
git branch
Git Tutorial | Git Basics - Branching, Merging, Rebasing | Learn Git | DevOps Tutorial | Edureka
Ad

Recommended

PDF
Git and github 101
Senthilkumar Gopal
 
PDF
Git real slides
Lucas Couto
 
PPTX
Git Lab Introduction
Krunal Doshi
 
PDF
What's New for GitLab CI/CD February 2020
Noa Harel
 
PDF
Gitlab, GitOps & ArgoCD
Haggai Philip Zagury
 
PPTX
Git & GitLab
Gaurav Wable
 
PDF
Introduction to GitHub Actions
Bo-Yi Wu
 
PPTX
Git branching strategies
jstack
 
PDF
Git slides
Nanyak S
 
PDF
Continuous Integration/Deployment with Gitlab CI
David Hahn
 
PDF
Introducing GitLab (June 2018)
Noa Harel
 
PPTX
Basic Git Intro
Yoad Snapir
 
PDF
Gitlab ci-cd
Dan MAGIER
 
PPTX
Git
Shinu Suresh
 
PPTX
Git and GitFlow branching model
Pavlo Hodysh
 
PDF
GITS Class #16: CI/CD (Continuous Integration & Continuous Deployment) with G...
GITS Indonesia
 
PPT
Git basic
Emran Ul Hadi
 
PPTX
Git One Day Training Notes
glen_a_smith
 
PDF
Using GitLab CI
ColCh
 
PPTX
Transforming Organizations with CI/CD
Cprime
 
KEY
Introduction to Git
Lukas Fittl
 
PDF
Introducing GitLab (September 2018)
Noa Harel
 
PPTX
Intro to git and git hub
Venkat Malladi
 
PDF
Gitops: the kubernetes way
sparkfabrik
 
PPTX
Cloud Native: what is it? Why?
Juan Pablo Genovese
 
PPTX
Introduction to Gitlab | Gitlab 101 | Training Session
Anwarul Islam
 
PDF
What is Git | What is GitHub | Git Tutorial | GitHub Tutorial | Devops Tutori...
Edureka!
 
PDF
Introduction to Git
Yan Vugenfirer
 
PDF
Introduction to DevOps | Edureka
Edureka!
 
PDF
DevOps Service | Mindtree
AnikeyRoy
 

More Related Content

What's hot (20)

PDF
Git slides
Nanyak S
 
PDF
Continuous Integration/Deployment with Gitlab CI
David Hahn
 
PDF
Introducing GitLab (June 2018)
Noa Harel
 
PPTX
Basic Git Intro
Yoad Snapir
 
PDF
Gitlab ci-cd
Dan MAGIER
 
PPTX
Git
Shinu Suresh
 
PPTX
Git and GitFlow branching model
Pavlo Hodysh
 
PDF
GITS Class #16: CI/CD (Continuous Integration & Continuous Deployment) with G...
GITS Indonesia
 
PPT
Git basic
Emran Ul Hadi
 
PPTX
Git One Day Training Notes
glen_a_smith
 
PDF
Using GitLab CI
ColCh
 
PPTX
Transforming Organizations with CI/CD
Cprime
 
KEY
Introduction to Git
Lukas Fittl
 
PDF
Introducing GitLab (September 2018)
Noa Harel
 
PPTX
Intro to git and git hub
Venkat Malladi
 
PDF
Gitops: the kubernetes way
sparkfabrik
 
PPTX
Cloud Native: what is it? Why?
Juan Pablo Genovese
 
PPTX
Introduction to Gitlab | Gitlab 101 | Training Session
Anwarul Islam
 
PDF
What is Git | What is GitHub | Git Tutorial | GitHub Tutorial | Devops Tutori...
Edureka!
 
PDF
Introduction to Git
Yan Vugenfirer
 
Git slides
Nanyak S
 
Continuous Integration/Deployment with Gitlab CI
David Hahn
 
Introducing GitLab (June 2018)
Noa Harel
 
Basic Git Intro
Yoad Snapir
 
Gitlab ci-cd
Dan MAGIER
 
Git and GitFlow branching model
Pavlo Hodysh
 
GITS Class #16: CI/CD (Continuous Integration & Continuous Deployment) with G...
GITS Indonesia
 
Git basic
Emran Ul Hadi
 
Git One Day Training Notes
glen_a_smith
 
Using GitLab CI
ColCh
 
Transforming Organizations with CI/CD
Cprime
 
Introduction to Git
Lukas Fittl
 
Introducing GitLab (September 2018)
Noa Harel
 
Intro to git and git hub
Venkat Malladi
 
Gitops: the kubernetes way
sparkfabrik
 
Cloud Native: what is it? Why?
Juan Pablo Genovese
 
Introduction to Gitlab | Gitlab 101 | Training Session
Anwarul Islam
 
What is Git | What is GitHub | Git Tutorial | GitHub Tutorial | Devops Tutori...
Edureka!
 
Introduction to Git
Yan Vugenfirer
 

Similar to Git Tutorial | Git Basics - Branching, Merging, Rebasing | Learn Git | DevOps Tutorial | Edureka (20)

PDF
Introduction to DevOps | Edureka
Edureka!
 
PDF
DevOps Service | Mindtree
AnikeyRoy
 
PDF
Git tech
Taj Nehme
 
PPTX
Webinar on "DevOps LifeCycle and SCM using common Git commands for version co...
Agile Testing Alliance
 
PDF
Increase the Velocity of Your Software Releases Using GitHub and DeployHub
DevOps.com
 
PPTX
Cleaning Up the Mess: Modernizing Your Dev Team’s Outdated Workflow
Bohyun Kim
 
PPTX
Git essential training & sharing self
Chen-Tien Tsai
 
PDF
DevOps_1698587929.pdf cours ciCd automatique
khezzanehouria8
 
PPTX
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
Simplilearn
 
PPTX
Git session 1
Hassan Khan
 
PPTX
Lyra Infosystems - GitLab Overview Deck 2020
Lyra Infosystems Pvt. Ltd
 
PDF
Git Tutorial
Ahmed Taha
 
PDF
Introduction to Git for Force.com Developers
Salesforce Developers
 
PPT
Dreamforce 13 developer session: Git for Force.com developers
John Stevenson
 
PDF
Scaling Git for Enterprise DevOps
Eng Teong Cheah
 
PDF
Next Level DevOps Implementation with GitOps
Ramadoni Ashudi
 
PPTX
DevOps Interview Questions Part - 1 | Devops Interview Questions And Answers ...
Simplilearn
 
PDF
Be a Happier Developer with Git / Productive Team #gettinggitright
Shunsuke (Sean) Osawa
 
PDF
Introduction to Git
InCycleSoftware
 
PDF
GitHub for partners
Lorenzo Barbieri
 
Introduction to DevOps | Edureka
Edureka!
 
DevOps Service | Mindtree
AnikeyRoy
 
Git tech
Taj Nehme
 
Webinar on "DevOps LifeCycle and SCM using common Git commands for version co...
Agile Testing Alliance
 
Increase the Velocity of Your Software Releases Using GitHub and DeployHub
DevOps.com
 
Cleaning Up the Mess: Modernizing Your Dev Team’s Outdated Workflow
Bohyun Kim
 
Git essential training & sharing self
Chen-Tien Tsai
 
DevOps_1698587929.pdf cours ciCd automatique
khezzanehouria8
 
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
Simplilearn
 
Git session 1
Hassan Khan
 
Lyra Infosystems - GitLab Overview Deck 2020
Lyra Infosystems Pvt. Ltd
 
Git Tutorial
Ahmed Taha
 
Introduction to Git for Force.com Developers
Salesforce Developers
 
Dreamforce 13 developer session: Git for Force.com developers
John Stevenson
 
Scaling Git for Enterprise DevOps
Eng Teong Cheah
 
Next Level DevOps Implementation with GitOps
Ramadoni Ashudi
 
DevOps Interview Questions Part - 1 | Devops Interview Questions And Answers ...
Simplilearn
 
Be a Happier Developer with Git / Productive Team #gettinggitright
Shunsuke (Sean) Osawa
 
Introduction to Git
InCycleSoftware
 
GitHub for partners
Lorenzo Barbieri
 
Ad

More from Edureka! (20)

PDF
What to learn during the 21 days Lockdown | Edureka
Edureka!
 
PDF
Top 10 Dying Programming Languages in 2020 | Edureka
Edureka!
 
PDF
Top 5 Trending Business Intelligence Tools | Edureka
Edureka!
 
PDF
Tableau Tutorial for Data Science | Edureka
Edureka!
 
PDF
Python Programming Tutorial | Edureka
Edureka!
 
PDF
Top 5 PMP Certifications | Edureka
Edureka!
 
PDF
Top Maven Interview Questions in 2020 | Edureka
Edureka!
 
PDF
Linux Mint Tutorial | Edureka
Edureka!
 
PDF
How to Deploy Java Web App in AWS| Edureka
Edureka!
 
PDF
Importance of Digital Marketing | Edureka
Edureka!
 
PDF
RPA in 2020 | Edureka
Edureka!
 
PDF
Email Notifications in Jenkins | Edureka
Edureka!
 
PDF
EA Algorithm in Machine Learning | Edureka
Edureka!
 
PDF
Cognitive AI Tutorial | Edureka
Edureka!
 
PDF
AWS Cloud Practitioner Tutorial | Edureka
Edureka!
 
PDF
Blue Prism Top Interview Questions | Edureka
Edureka!
 
PDF
Big Data on AWS Tutorial | Edureka
Edureka!
 
PDF
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
Edureka!
 
PDF
Kubernetes Installation on Ubuntu | Edureka
Edureka!
 
PDF
ITIL® Tutorial for Beginners | ITIL® Foundation Training | Edureka
Edureka!
 
What to learn during the 21 days Lockdown | Edureka
Edureka!
 
Top 10 Dying Programming Languages in 2020 | Edureka
Edureka!
 
Top 5 Trending Business Intelligence Tools | Edureka
Edureka!
 
Tableau Tutorial for Data Science | Edureka
Edureka!
 
Python Programming Tutorial | Edureka
Edureka!
 
Top 5 PMP Certifications | Edureka
Edureka!
 
Top Maven Interview Questions in 2020 | Edureka
Edureka!
 
Linux Mint Tutorial | Edureka
Edureka!
 
How to Deploy Java Web App in AWS| Edureka
Edureka!
 
Importance of Digital Marketing | Edureka
Edureka!
 
RPA in 2020 | Edureka
Edureka!
 
Email Notifications in Jenkins | Edureka
Edureka!
 
EA Algorithm in Machine Learning | Edureka
Edureka!
 
Cognitive AI Tutorial | Edureka
Edureka!
 
AWS Cloud Practitioner Tutorial | Edureka
Edureka!
 
Blue Prism Top Interview Questions | Edureka
Edureka!
 
Big Data on AWS Tutorial | Edureka
Edureka!
 
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
Edureka!
 
Kubernetes Installation on Ubuntu | Edureka
Edureka!
 
ITIL® Tutorial for Beginners | ITIL® Foundation Training | Edureka
Edureka!
 
Ad

Recently uploaded (20)

PDF
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
PDF
Database Benchmarking for Performance Masterclass: Session 2 - Data Modeling ...
ScyllaDB
 
PPTX
Smarter Governance with AI: What Every Board Needs to Know
OnBoard
 
PDF
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Priyanka Aash
 
PDF
Plugging AI into everything: Model Context Protocol Simplified.pdf
Abati Adewale
 
PPTX
UserCon Belgium: Honey, VMware increased my bill
stijn40
 
PPTX
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
 
PDF
Java 25 and Beyond - A Roadmap of Innovations
Ana-Maria Mihalceanu
 
PDF
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
Edge AI and Vision Alliance
 
PDF
“Scaling i.MX Applications Processors’ Native Edge AI with Discrete AI Accele...
Edge AI and Vision Alliance
 
PDF
FME as an Orchestration Tool with Principles From Data Gravity
Safe Software
 
PDF
Kubernetes - Architecture & Components.pdf
geethak285
 
PPTX
Simplifica la seguridad en la nube y la detección de amenazas con FortiCNAPP
Cristian Garcia G.
 
PDF
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
 
DOCX
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
PDF
2025_06_18 - OpenMetadata Community Meeting.pdf
OpenMetadata
 
PPTX
reInforce 2025 Lightning Talk - Scott Francis.pptx
ScottFrancis51
 
PDF
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
PPTX
Practical Applications of AI in Local Government
OnBoard
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
Database Benchmarking for Performance Masterclass: Session 2 - Data Modeling ...
ScyllaDB
 
Smarter Governance with AI: What Every Board Needs to Know
OnBoard
 
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Priyanka Aash
 
Plugging AI into everything: Model Context Protocol Simplified.pdf
Abati Adewale
 
UserCon Belgium: Honey, VMware increased my bill
stijn40
 
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
 
Java 25 and Beyond - A Roadmap of Innovations
Ana-Maria Mihalceanu
 
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
Edge AI and Vision Alliance
 
“Scaling i.MX Applications Processors’ Native Edge AI with Discrete AI Accele...
Edge AI and Vision Alliance
 
FME as an Orchestration Tool with Principles From Data Gravity
Safe Software
 
Kubernetes - Architecture & Components.pdf
geethak285
 
Simplifica la seguridad en la nube y la detección de amenazas con FortiCNAPP
Cristian Garcia G.
 
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
 
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
2025_06_18 - OpenMetadata Community Meeting.pdf
OpenMetadata
 
reInforce 2025 Lightning Talk - Scott Francis.pptx
ScottFrancis51
 
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
Practical Applications of AI in Local Government
OnBoard
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 

Git Tutorial | Git Basics - Branching, Merging, Rebasing | Learn Git | DevOps Tutorial | Edureka

  • 2. Devops Certification Training www.edureka.co/devops Topics For Today’s Session Version Control System Version Control System Types Version Control Tools Git Workflow Parallel Development & Stashing Hands-On 1 2 3 4 5 6
  • 3. Copyright © 2018, edureka and/or its affiliates. All rights reserved. Scenario From Company
  • 4. Devops Certification Training www.edureka.co/devops Scenario Of A Company I hope client likes this new feature!
  • 5. Devops Certification Training www.edureka.co/devops Scenario Of A Company Sure! I will remove this feature I do not like it! So please remove this feature
  • 6. Devops Certification Training www.edureka.co/devops Scenario Of A Company But I have already deleted that code! I have to re write the whole code again Hey! I want that feature back!
  • 7. Devops Certification Training www.edureka.co/devops Once saved, all changes are permanent and can’t be reverted back. Downtime may occur due to faulty updates, since there is no backup maintained No collaboration between the team. So no records are maintained. Chaos Caused Without Version Control
  • 8. Copyright © 2018, edureka and/or its affiliates. All rights reserved. Version Control
  • 9. Devops Certification Training www.edureka.co/devops Version Control System Version control is the management of changes to documents, computer programs, large web sites, and other collections of information. These changes are usually termed as “versions”.
  • 10. Copyright © 2018, edureka and/or its affiliates. All rights reserved. Version Control Types
  • 11. Devops Certification Training www.edureka.co/devops Version Control Types Distributed Version Control SystemCentralized Version Control System Repository Repository Repository Repository Working Copy Working Copy Working Copy Workstation/ PC #1 Workstation/ PC #2 Workstation/ PC #3 Commit Update Commit Update Commit Update Push Pull Server Repository Working Copy Working Copy Working Copy Workstation/ PC #1 Workstation/ PC #2 Workstation/ PC #3 Server Commit Update
  • 12. Devops Certification Training www.edureka.co/devops Version Control System Tools Version control has various tools like Git, Apache Subversion, Concurrent Version Systems, Team Foundation Server, Mercurial etc.
  • 13. Devops Certification Training www.edureka.co/devops Released under GPL’s license. It is for free and is open source. Why Git wins over other tools? Economical Non -Linear Snapshots Distributed Speed Robust Integrity Branching
  • 14. Devops Certification Training www.edureka.co/devops Released under GPL’s license. It is for free and is open source. Supports non-linear development of software. Why Git wins over other tools? Economical Non -Linear Snapshots Distributed Speed Robust Integrity Branching
  • 15. Devops Certification Training www.edureka.co/devops Released under GPL’s license. It is for free and is open source. Supports non-linear development of software. Records changes made to a file rather than file itself. Why Git wins over other tools? Economical Non -Linear Snapshots Distributed Speed Robust Integrity Branching
  • 16. Devops Certification Training www.edureka.co/devops Released under GPL’s license. It is for free and is open source. Supports non-linear development of software. Records changes made to a file rather than file itself. Every user has his own copy of the repository data stored locally. Why Git wins over other tools? Economical Non -Linear Snapshots Distributed Speed Robust Integrity Branching
  • 17. Devops Certification Training www.edureka.co/devops Released under GPL’s license. It is for free and is open source. Supports non-linear development of software. Records changes made to a file rather than file itself. Every user has his own copy of the repository data stored locally. Speed offered by Git is lightening fast compared to other VCS’s. Why Git wins over other tools? Economical Non -Linear Snapshots Distributed Speed Robust Integrity Branching
  • 18. Devops Certification Training www.edureka.co/devops Released under GPL’s license. It is for free and is open source. Supports non-linear development of software. Records changes made to a file rather than file itself. Every user has his own copy of the repository data stored locally. Speed offered by Git is lightening fast compared to other VCS’s. Why Git wins over other tools? Nearly every task in Git is undo-able. Economical Non -Linear Snapshots Distributed Speed Robust Integrity Branching
  • 19. Devops Certification Training www.edureka.co/devops Released under GPL’s license. It is for free and is open source. Supports non-linear development of software. Records changes made to a file rather than file itself. Every user has his own copy of the repository data stored locally. Speed offered by Git is lightening fast compared to other VCS’s. No changes can be made without Git recording it. Why Git wins over other tools? Nearly every task in Git is undo-able. Economical Non -Linear Snapshots Distributed Speed Robust Integrity Branching
  • 20. Devops Certification Training www.edureka.co/devops Released under GPL’s license. It is for free and is open source. Supports non-linear development of software. Records changes made to a file rather than file itself. Every user has his own copy of the repository data stored locally. Speed offered by Git is lightening fast compared to other VCS’s. No changes can be made without Git recording it. Why Git wins over other tools? Nearly every task in Git is undo-able. Every collaborator’s working directory is in itself a branch. Economical Non -Linear Snapshots Distributed Speed Robust Integrity Branching
  • 21. Devops Certification Training www.edureka.co/devops Released under GPL’s license. It is for free and is open source. Supports non-linear development of software. Records changes made to a file rather than file itself. Every user has his own copy of the repository data stored locally. Speed offered by Git is lightening fast compared to other VCS’s. No changes can be made without Git recording it. Why Git wins over other tools? Nearly every task in Git is undo-able. Every collaborator’s working directory is in itself a branch. Economical Non -Linear Snapshots Distributed Speed Robust Integrity Branching
  • 22. Devops Certification Training www.edureka.co/devops What is Git? Git is an open source Distributed Version Control System(DVCS) which records changes made to the files laying emphasis on speed, data integrity and distributed, non-linear workflows
  • 23. Devops Certification Training www.edureka.co/devops Workflow of Git
  • 24. Devops Certification Training www.edureka.co/devops Workflow Of Git
  • 25. Copyright © 2018, edureka and/or its affiliates. All rights reserved. Parallel Development
  • 26. Devops Certification Training www.edureka.co/devops Branching Branching is an integral part of any Version Control(VC) System. Unlike other VC’s Git does not create a copy of existing files for new branch. It points to snapshot of the changes you have made in the system
  • 27. Devops Certification Training www.edureka.co/devops Merging Merging integrates the changes made in different branches into one single branch
  • 28. Devops Certification Training www.edureka.co/devops Rebasing Used when changes made in one branch needs to be reflected in another branch
  • 29. Copyright © 2018, edureka and/or its affiliates. All rights reserved. Stashing
  • 30. Devops Certification Training www.edureka.co/devops Stashing Used when changes made in one branch needs to be reflected in another branch
  • 31. Copyright © 2018, edureka and/or its affiliates. All rights reserved. Hands-On
  • 32. Devops Certification Training www.edureka.co/devops Hands-On – Problem Statement Company want a better Source Code Management System because the earlier tool had the tendency to save redundant code. Multiple Developers working simultaneously on same block of code also caused problems.
  • 33. Devops Certification Training www.edureka.co/devops Hands-On – Solution Task is to move the company’s code base to git and Github.
  • 34. Devops Certification Training www.edureka.co/devops Git Commands Basic Commands sudo apt-get install git git config --global user.name “username” git initgit add <filename> git status git commit git diff git rm <filename> git rm --cached <filename> git rm -f <filename> git log git tag --a <annotation> --m <message> git add remote origin <remote link> git tag git show <tag-name> git push origin master git push origin --tags git pull origin git fetch origin
  • 35. Devops Certification Training www.edureka.co/devops Git Commands git stash pop git stash save ‘message’ git stash list git stash apply <stash id> git stash drop <stack id> git stash clear Stashing Commands Branching Commands git branch <branchname> git checkout <branchname> git branch -D <branchname>git branch -d <branchname> git merge <branchname> git branch