SlideShare a Scribd company logo
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

More Related Content

What's hot

The everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitThe everyday developer's guide to version control with Git
The everyday developer's guide to version control with Git
E Carter
 
Devops Porto - CI/CD at Gitlab
Devops Porto - CI/CD at GitlabDevops Porto - CI/CD at Gitlab
Devops Porto - CI/CD at Gitlab
Filipa Lacerda
 
Gitlab CI/CD
Gitlab CI/CDGitlab CI/CD
Gitlab CI/CD
JEMLI Fathi
 
Version control
Version controlVersion control
Version control
visual28
 
Git & GitLab
Git & GitLabGit & GitLab
Git & GitLab
Gaurav Wable
 
Git and GitFlow branching model
Git and GitFlow branching modelGit and GitFlow branching model
Git and GitFlow branching model
Pavlo Hodysh
 
Git Version Control System
Git Version Control SystemGit Version Control System
Git Version Control System
KMS Technology
 
Git n git hub
Git n git hubGit n git hub
Git n git hub
Jiwon Baek
 
Migrating To GitHub
Migrating To GitHub  Migrating To GitHub
Migrating To GitHub
Sridhar Peddinti
 
Case Study: Migration to GitLab (from Bitbucket) at AppsFlyer
Case Study: Migration to GitLab (from Bitbucket) at AppsFlyerCase Study: Migration to GitLab (from Bitbucket) at AppsFlyer
Case Study: Migration to GitLab (from Bitbucket) at AppsFlyer
Noa Harel
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notes
glen_a_smith
 
Git Introduction Tutorial
Git Introduction TutorialGit Introduction Tutorial
Git Introduction Tutorial
Thomas Rausch
 
Introducing GitLab
Introducing GitLabIntroducing GitLab
Introducing GitLab
Taisuke Inoue
 
Git for beginners
Git for beginnersGit for beginners
Git for beginners
Arulmurugan Rajaraman
 
Git and github 101
Git and github 101Git and github 101
Git and github 101
Senthilkumar Gopal
 
Version Control & Git
Version Control & GitVersion Control & Git
Version Control & Git
Craig Smith
 
Introduction to Git and GitHub
Introduction to Git and GitHubIntroduction to Git and GitHub
Introduction to Git and GitHub
Vikram SV
 
Git 101 for Beginners
Git 101 for Beginners Git 101 for Beginners
Git 101 for Beginners
Anurag Upadhaya
 
Intro to git and git hub
Intro to git and git hubIntro to git and git hub
Intro to git and git hub
Venkat Malladi
 
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Simplilearn
 

What's hot (20)

The everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitThe everyday developer's guide to version control with Git
The everyday developer's guide to version control with Git
 
Devops Porto - CI/CD at Gitlab
Devops Porto - CI/CD at GitlabDevops Porto - CI/CD at Gitlab
Devops Porto - CI/CD at Gitlab
 
Gitlab CI/CD
Gitlab CI/CDGitlab CI/CD
Gitlab CI/CD
 
Version control
Version controlVersion control
Version control
 
Git & GitLab
Git & GitLabGit & GitLab
Git & GitLab
 
Git and GitFlow branching model
Git and GitFlow branching modelGit and GitFlow branching model
Git and GitFlow branching model
 
Git Version Control System
Git Version Control SystemGit Version Control System
Git Version Control System
 
Git n git hub
Git n git hubGit n git hub
Git n git hub
 
Migrating To GitHub
Migrating To GitHub  Migrating To GitHub
Migrating To GitHub
 
Case Study: Migration to GitLab (from Bitbucket) at AppsFlyer
Case Study: Migration to GitLab (from Bitbucket) at AppsFlyerCase Study: Migration to GitLab (from Bitbucket) at AppsFlyer
Case Study: Migration to GitLab (from Bitbucket) at AppsFlyer
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notes
 
Git Introduction Tutorial
Git Introduction TutorialGit Introduction Tutorial
Git Introduction Tutorial
 
Introducing GitLab
Introducing GitLabIntroducing GitLab
Introducing GitLab
 
Git for beginners
Git for beginnersGit for beginners
Git for beginners
 
Git and github 101
Git and github 101Git and github 101
Git and github 101
 
Version Control & Git
Version Control & GitVersion Control & Git
Version Control & Git
 
Introduction to Git and GitHub
Introduction to Git and GitHubIntroduction to Git and GitHub
Introduction to Git and GitHub
 
Git 101 for Beginners
Git 101 for Beginners Git 101 for Beginners
Git 101 for Beginners
 
Intro to git and git hub
Intro to git and git hubIntro to git and git hub
Intro to git and git hub
 
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
 

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

Introduction to DevOps | Edureka
Introduction to DevOps | EdurekaIntroduction to DevOps | Edureka
Introduction to DevOps | Edureka
Edureka!
 
DevOps Service | Mindtree
DevOps Service | MindtreeDevOps Service | Mindtree
DevOps Service | Mindtree
AnikeyRoy
 
Git tech
Git techGit tech
Git tech
Taj Nehme
 
Webinar on "DevOps LifeCycle and SCM using common Git commands for version co...
Webinar on "DevOps LifeCycle and SCM using common Git commands for version co...Webinar on "DevOps LifeCycle and SCM using common Git commands for version co...
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
Increase the Velocity of Your Software Releases Using GitHub and DeployHubIncrease the Velocity of Your Software Releases Using GitHub and DeployHub
Increase the Velocity of Your Software Releases Using GitHub and DeployHub
DevOps.com
 
Cleaning Up the Mess: Modernizing Your Dev Team’s Outdated Workflow
Cleaning Up the Mess: Modernizing Your Dev Team’s Outdated WorkflowCleaning Up the Mess: Modernizing Your Dev Team’s Outdated Workflow
Cleaning Up the Mess: Modernizing Your Dev Team’s Outdated Workflow
Bohyun Kim
 
Git essential training & sharing self
Git essential training & sharing selfGit essential training & sharing self
Git essential training & sharing self
Chen-Tien Tsai
 
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
Simplilearn
 
Lyra Infosystems - GitLab Overview Deck 2020
Lyra Infosystems - GitLab Overview Deck 2020Lyra Infosystems - GitLab Overview Deck 2020
Lyra Infosystems - GitLab Overview Deck 2020
Lyra Infosystems Pvt. Ltd
 
Git Tutorial
Git Tutorial Git Tutorial
Git Tutorial
Ahmed Taha
 
Introduction to Git for Force.com Developers
Introduction to Git for Force.com DevelopersIntroduction to Git for Force.com Developers
Introduction to Git for Force.com Developers
Salesforce Developers
 
Dreamforce 13 developer session: Git for Force.com developers
Dreamforce 13 developer session: Git for Force.com developersDreamforce 13 developer session: Git for Force.com developers
Dreamforce 13 developer session: Git for Force.com developers
John Stevenson
 
Scaling Git for Enterprise DevOps
Scaling Git for Enterprise DevOpsScaling Git for Enterprise DevOps
Scaling Git for Enterprise DevOps
Eng Teong Cheah
 
Next Level DevOps Implementation with GitOps
Next Level DevOps Implementation with GitOpsNext Level DevOps Implementation with GitOps
Next Level DevOps Implementation with GitOps
Ramadoni Ashudi
 
DevOps Interview Questions Part - 1 | Devops Interview Questions And Answers ...
DevOps Interview Questions Part - 1 | Devops Interview Questions And Answers ...DevOps Interview Questions Part - 1 | Devops Interview Questions And Answers ...
DevOps Interview Questions Part - 1 | Devops Interview Questions And Answers ...
Simplilearn
 
Be a Happier Developer with Git / Productive Team #gettinggitright
Be a Happier Developer with Git / Productive Team #gettinggitright Be a Happier Developer with Git / Productive Team #gettinggitright
Be a Happier Developer with Git / Productive Team #gettinggitright
Shunsuke (Sean) Osawa
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
InCycleSoftware
 
GitHub for partners
GitHub for partnersGitHub for partners
GitHub for partners
Lorenzo Barbieri
 
version control system (2).pptx
version control system (2).pptxversion control system (2).pptx
version control system (2).pptx
DipanshuRaj19
 

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

Introduction to DevOps | Edureka
Introduction to DevOps | EdurekaIntroduction to DevOps | Edureka
Introduction to DevOps | Edureka
 
DevOps Service | Mindtree
DevOps Service | MindtreeDevOps Service | Mindtree
DevOps Service | Mindtree
 
Git tech
Git techGit tech
Git tech
 
Webinar on "DevOps LifeCycle and SCM using common Git commands for version co...
Webinar on "DevOps LifeCycle and SCM using common Git commands for version co...Webinar on "DevOps LifeCycle and SCM using common Git commands for version co...
Webinar on "DevOps LifeCycle and SCM using common Git commands for version co...
 
Increase the Velocity of Your Software Releases Using GitHub and DeployHub
Increase the Velocity of Your Software Releases Using GitHub and DeployHubIncrease the Velocity of Your Software Releases Using GitHub and DeployHub
Increase the Velocity of Your Software Releases Using GitHub and DeployHub
 
Cleaning Up the Mess: Modernizing Your Dev Team’s Outdated Workflow
Cleaning Up the Mess: Modernizing Your Dev Team’s Outdated WorkflowCleaning Up the Mess: Modernizing Your Dev Team’s Outdated Workflow
Cleaning Up the Mess: Modernizing Your Dev Team’s Outdated Workflow
 
Git essential training & sharing self
Git essential training & sharing selfGit essential training & sharing self
Git essential training & sharing self
 
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
 
Git session 1
Git session 1Git session 1
Git session 1
 
Lyra Infosystems - GitLab Overview Deck 2020
Lyra Infosystems - GitLab Overview Deck 2020Lyra Infosystems - GitLab Overview Deck 2020
Lyra Infosystems - GitLab Overview Deck 2020
 
Git Tutorial
Git Tutorial Git Tutorial
Git Tutorial
 
Introduction to Git for Force.com Developers
Introduction to Git for Force.com DevelopersIntroduction to Git for Force.com Developers
Introduction to Git for Force.com Developers
 
Dreamforce 13 developer session: Git for Force.com developers
Dreamforce 13 developer session: Git for Force.com developersDreamforce 13 developer session: Git for Force.com developers
Dreamforce 13 developer session: Git for Force.com developers
 
Scaling Git for Enterprise DevOps
Scaling Git for Enterprise DevOpsScaling Git for Enterprise DevOps
Scaling Git for Enterprise DevOps
 
Next Level DevOps Implementation with GitOps
Next Level DevOps Implementation with GitOpsNext Level DevOps Implementation with GitOps
Next Level DevOps Implementation with GitOps
 
DevOps Interview Questions Part - 1 | Devops Interview Questions And Answers ...
DevOps Interview Questions Part - 1 | Devops Interview Questions And Answers ...DevOps Interview Questions Part - 1 | Devops Interview Questions And Answers ...
DevOps Interview Questions Part - 1 | Devops Interview Questions And Answers ...
 
Be a Happier Developer with Git / Productive Team #gettinggitright
Be a Happier Developer with Git / Productive Team #gettinggitright Be a Happier Developer with Git / Productive Team #gettinggitright
Be a Happier Developer with Git / Productive Team #gettinggitright
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
GitHub for partners
GitHub for partnersGitHub for partners
GitHub for partners
 
version control system (2).pptx
version control system (2).pptxversion control system (2).pptx
version control system (2).pptx
 

More from Edureka!

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

More from Edureka! (20)

What to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | EdurekaWhat to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | Edureka
 
Top 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | EdurekaTop 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | Edureka
 
Top 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | EdurekaTop 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | Edureka
 
Tableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | EdurekaTableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | Edureka
 
Python Programming Tutorial | Edureka
Python Programming Tutorial | EdurekaPython Programming Tutorial | Edureka
Python Programming Tutorial | Edureka
 
Top 5 PMP Certifications | Edureka
Top 5 PMP Certifications | EdurekaTop 5 PMP Certifications | Edureka
Top 5 PMP Certifications | Edureka
 
Top Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | EdurekaTop Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | Edureka
 
Linux Mint Tutorial | Edureka
Linux Mint Tutorial | EdurekaLinux Mint Tutorial | Edureka
Linux Mint Tutorial | Edureka
 
How to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| EdurekaHow to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| Edureka
 
Importance of Digital Marketing | Edureka
Importance of Digital Marketing | EdurekaImportance of Digital Marketing | Edureka
Importance of Digital Marketing | Edureka
 
RPA in 2020 | Edureka
RPA in 2020 | EdurekaRPA in 2020 | Edureka
RPA in 2020 | Edureka
 
Email Notifications in Jenkins | Edureka
Email Notifications in Jenkins | EdurekaEmail Notifications in Jenkins | Edureka
Email Notifications in Jenkins | Edureka
 
EA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | EdurekaEA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | Edureka
 
Cognitive AI Tutorial | Edureka
Cognitive AI Tutorial | EdurekaCognitive AI Tutorial | Edureka
Cognitive AI Tutorial | Edureka
 
AWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | EdurekaAWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | Edureka
 
Blue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | EdurekaBlue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | Edureka
 
Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka
 
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | EdurekaA star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
 
Kubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | EdurekaKubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | Edureka
 
ITIL® Tutorial for Beginners | ITIL® Foundation Training | Edureka
ITIL® Tutorial for Beginners | ITIL® Foundation Training | EdurekaITIL® Tutorial for Beginners | ITIL® Foundation Training | Edureka
ITIL® Tutorial for Beginners | ITIL® Foundation Training | Edureka
 

Recently uploaded

ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 

Recently uploaded (20)

ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 

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

  • 1.
  • 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