SlideShare a Scribd company logo
1 of 78
Introduction to
Version Control
Agenda
◎ Overview of Version Control
◎ Getting started with Git
◎ Basic Git daily commands
◎ Advanced Git commands
◎ Git-related files
◎ Resolve conflicts
◎ Version Control and DevOps
◎ Productivity tools
2
1.
Overview of Version
Control
3
Version Control System
◎ A software that records changes made to a set of files
over time, allowing specific history to be recalled and
restored as necessary.
4
5
VCS example
6
VCS example
7
VCS example
1. 1
Use cases
8
Backups
◎ Accidentally delete the file without backups.
9
Backups
◎ Accidentally delete the file without backups.
◎ Version Control makes backups, we can recover.
10
Backups (alternatives)
◎ Manually backup files with timestamp
◎ Online file hosting websites
11
Backups (alternatives)
12
History and Changes
◎ No clues what / why changes has been made.
13
History and Changes
◎ No clues what / why changes has been made.
◎ Version Control keeps a history line-by-line with a
description.
14
History and Changes
15
Experiment
◎ In case of running some experiment, you need to
create a new project since it will affect the existing
main project.
16
Experiment
◎ In case of running some experiment, you need to
create a new project since it will affect the existing
main project.
◎ Version Control allows us to create experiment
sections.
17
Collaboration
◎ Unable to collaborate since the file belongs to one
person at a time.
18
Collaboration
◎ Unable to collaborate since the file belongs to one
person at a time.
◎ Version Controls allows us to work at the same file, at
the same time.
19
Version Control offers ...
◎ Backups
◎ History records
◎ Changes
◎ Experiment
◎ Collaboration
20
1. 2
Types of Version
Control System
21
Centralized vs Distributed
22
Centralized VCS Distributed VCS
Speed Slow Fast
Offline mode
No Yes
23
Centralized vs Distributed
2.
Getting started with
Git
24
Git gives you ...
◎ Distributed version control system
◎ Speed
◎ Free and Open-source
◎ Staging area
25
How Git works
26
Online shopping analogy
27
Add stuffs to cart Order
confirmation
Git hosting providers
◎ GitHub
◎ GitLab
◎ Bitbucket
◎ Azure DevOps
28
3.
Basic Git daily
commands
29
Initializing
git init
30
Create an empty Git repository.
Initializing
git init
31
Staging
git add <file>
32
Indicate which files and their states are to be included in
the next commit.
Staging
git add <file>
33
Status
git status
34
See the status of the repository.
Committing
git commit -m “<commit-message>”
35
Place copies (snapshots) of working directory back into the
repository as a new version.
Committing
git commit -m “<commit-message>”
36
Syncing
git remote [add | set-url] <remote> <url>
37
Sync the local repository to the remote repository.
Syncing
git remote [add | set-url] <remote> <url>
38
Pushing
git push -u <remote> <branch>
39
Push changes up to a branch of a remote repository.
Pushing
git push -u <remote> <branch>
40
Pulling
git pull <remote> <branch>
41
Pull changes from (a branch of) a remote repository.
Pulling
git pull <remote> <branch>
42
Cloning
git clone <remote-url>
43
Get your own local copy of an existing repository.
44
4.
Advanced Git
commands
45
4. 1
View history
46
Logging
git log <object>
47
Review the history of committed snapshots.
Difference
git diff <path> <path>
48
Explore differences between the workspace, the staging
area, and commits.
Difference
git diff <path> <path>
49
Tagging
git tag <tag-name>
50
Another way to track the history of a repository via certain
milestone commits.
4. 2
Recovery
51
Checkout
git checkout “<commit>”
52
Explore the state associated with a specific commit.
Checkout
git checkout “<commit>”
53
Reset
git reset [--soft | --hard] <commit>
54
Return to a previous state, effectively erasing subsequent
commits.
Reset
git reset [--soft | --hard] <commit>
55
Revert
git revert <commit>
56
Generate a new commit that reverses the changes
introduced by a commit.
4. 3
Branching
57
Branching
◎ Isolating environment from main development line
without impact.
◎ For example, developing new features without
affecting production-quality code.
◎ Encouraging experiment purposes.
58
Branching example
59
Branching
git branch <branch-name>
60
Take edits in the project in a new direction to allow for
modifications that will not affect the main branch.
Merging
git merge <branch-name>
61
Incorporate changes in a branch into another branch
(typically master).
Merging
62
Rebasing
git rebase <branch-name>
63
Apply all changes of a branch on top of another branch by
creating a new commit.
Rebasing
64
Merging vs Rebasing
Safety vs
Traceability
65
Stashing
git stash [pop | apply | list | clear]
66
Record the current state of the working directory and the
index, but want to go back to a clean working directory.
5.
Git-related files
67
.gitignore
68
Ignore files that we don't want to get staged and
committed.
.gitconfig
69
Git configuration file contains a number of variables that
affect the Git commands' behavior.
6.
Resolving conflicts
70
7.
Git and DevOps
71
73
8.
Productivity tools
74
Text editors / IDE
75
Git Kraken
76
gitignore.io
77
Thanks!
Contact us:
Raksit Mantanacharu
raksit.mantanacharu1@exxonmobil.com
78

More Related Content

What's hot

Contributing to open source using Git
Contributing to open source using GitContributing to open source using Git
Contributing to open source using GitYan Vugenfirer
 
Version control system and Git
Version control system and GitVersion control system and Git
Version control system and Gitramubonkuri
 
Introduction to Git and Github - Google Developer Student Clubs CET, Trivandrum
Introduction to Git and Github - Google Developer Student Clubs CET, TrivandrumIntroduction to Git and Github - Google Developer Student Clubs CET, Trivandrum
Introduction to Git and Github - Google Developer Student Clubs CET, TrivandrumAbhijitNarayan2
 
The Git Basics
The Git BasicsThe Git Basics
The Git BasicsNetguru
 
Using GIT for Everyone
Using GIT for EveryoneUsing GIT for Everyone
Using GIT for EveryoneGLC Networks
 
Beginner's guide to git
Beginner's guide to gitBeginner's guide to git
Beginner's guide to gitLim Sim
 
Enabling GitOps - Architecture for Implementation
Enabling GitOps - Architecture for ImplementationEnabling GitOps - Architecture for Implementation
Enabling GitOps - Architecture for ImplementationHuynh Thai Bao
 
Version control system
Version control systemVersion control system
Version control systemAndrew Liu
 
Common Git Commands
Common Git CommandsCommon Git Commands
Common Git CommandsHTS Hosting
 

What's hot (20)

Git presentation
Git presentationGit presentation
Git presentation
 
Git 101
Git 101Git 101
Git 101
 
Contributing to open source using Git
Contributing to open source using GitContributing to open source using Git
Contributing to open source using Git
 
Version control system and Git
Version control system and GitVersion control system and Git
Version control system and Git
 
Introduction to Git and Github - Google Developer Student Clubs CET, Trivandrum
Introduction to Git and Github - Google Developer Student Clubs CET, TrivandrumIntroduction to Git and Github - Google Developer Student Clubs CET, Trivandrum
Introduction to Git and Github - Google Developer Student Clubs CET, Trivandrum
 
The Git Basics
The Git BasicsThe Git Basics
The Git Basics
 
Introduction into Git
Introduction into GitIntroduction into Git
Introduction into Git
 
Using GIT for Everyone
Using GIT for EveryoneUsing GIT for Everyone
Using GIT for Everyone
 
Git Training
Git TrainingGit Training
Git Training
 
Beginner's guide to git
Beginner's guide to gitBeginner's guide to git
Beginner's guide to git
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Git
GitGit
Git
 
Enabling GitOps - Architecture for Implementation
Enabling GitOps - Architecture for ImplementationEnabling GitOps - Architecture for Implementation
Enabling GitOps - Architecture for Implementation
 
Git introduction
Git introductionGit introduction
Git introduction
 
Git Tricks
Git TricksGit Tricks
Git Tricks
 
GDSC - Introduction to GIT
GDSC - Introduction to GITGDSC - Introduction to GIT
GDSC - Introduction to GIT
 
Version control system
Version control systemVersion control system
Version control system
 
GIT
GITGIT
GIT
 
Common Git Commands
Common Git CommandsCommon Git Commands
Common Git Commands
 
SVN 2 Git
SVN 2 GitSVN 2 Git
SVN 2 Git
 

Similar to Introduction to Version Control

Collaborative development with Git | Workshop
Collaborative development with Git | WorkshopCollaborative development with Git | Workshop
Collaborative development with Git | WorkshopAnuchit Chalothorn
 
GITHappens, powerpoint about git and github
GITHappens, powerpoint about git and githubGITHappens, powerpoint about git and github
GITHappens, powerpoint about git and githubalidor4702
 
Advanced Web Development in PHP - Code Versioning and Branching with Git
Advanced Web Development in PHP - Code Versioning and Branching with GitAdvanced Web Development in PHP - Code Versioning and Branching with Git
Advanced Web Development in PHP - Code Versioning and Branching with GitRasan Samarasinghe
 
Git from the trenches
Git from the trenchesGit from the trenches
Git from the trenchesNuno Caneco
 
Git_and_GitHub Integration_with_Guidewire
Git_and_GitHub Integration_with_GuidewireGit_and_GitHub Integration_with_Guidewire
Git_and_GitHub Integration_with_GuidewireGandhi Ramu
 
Presentation on Repository Control System
Presentation on Repository Control SystemPresentation on Repository Control System
Presentation on Repository Control SystemMd. Mujahid Islam
 
Git tutorial undoing changes
Git tutorial   undoing changesGit tutorial   undoing changes
Git tutorial undoing changesLearningTech
 
Git interview questions | Edureka
Git interview questions | EdurekaGit interview questions | Edureka
Git interview questions | EdurekaEdureka!
 
Version Control with Git & GitHub
Version Control with Git & GitHubVersion Control with Git & GitHub
Version Control with Git & GitHubPiet Cordemans
 
Amending and Testing changes lab guide
Amending and Testing changes lab guideAmending and Testing changes lab guide
Amending and Testing changes lab guideopenstackcisco
 
Version Control History and Git Basics
Version Control History and Git BasicsVersion Control History and Git Basics
Version Control History and Git BasicsSreedath N S
 

Similar to Introduction to Version Control (20)

Collaborative development with Git | Workshop
Collaborative development with Git | WorkshopCollaborative development with Git | Workshop
Collaborative development with Git | Workshop
 
Git
GitGit
Git
 
GITHappens, powerpoint about git and github
GITHappens, powerpoint about git and githubGITHappens, powerpoint about git and github
GITHappens, powerpoint about git and github
 
Advanced Web Development in PHP - Code Versioning and Branching with Git
Advanced Web Development in PHP - Code Versioning and Branching with GitAdvanced Web Development in PHP - Code Versioning and Branching with Git
Advanced Web Development in PHP - Code Versioning and Branching with Git
 
Git from the trenches
Git from the trenchesGit from the trenches
Git from the trenches
 
Introduction git
Introduction gitIntroduction git
Introduction git
 
Git_and_GitHub Integration_with_Guidewire
Git_and_GitHub Integration_with_GuidewireGit_and_GitHub Integration_with_Guidewire
Git_and_GitHub Integration_with_Guidewire
 
Git.pptx
Git.pptxGit.pptx
Git.pptx
 
Presentation on Repository Control System
Presentation on Repository Control SystemPresentation on Repository Control System
Presentation on Repository Control System
 
Version controll.pptx
Version controll.pptxVersion controll.pptx
Version controll.pptx
 
Git basics for beginners
Git basics for beginnersGit basics for beginners
Git basics for beginners
 
Git tutorial undoing changes
Git tutorial   undoing changesGit tutorial   undoing changes
Git tutorial undoing changes
 
git2.ppt
git2.pptgit2.ppt
git2.ppt
 
Git interview questions | Edureka
Git interview questions | EdurekaGit interview questions | Edureka
Git interview questions | Edureka
 
GIT
GITGIT
GIT
 
Version Control with Git & GitHub
Version Control with Git & GitHubVersion Control with Git & GitHub
Version Control with Git & GitHub
 
Amending and Testing changes lab guide
Amending and Testing changes lab guideAmending and Testing changes lab guide
Amending and Testing changes lab guide
 
Version control
Version controlVersion control
Version control
 
Git Init (Introduction to Git)
Git Init (Introduction to Git)Git Init (Introduction to Git)
Git Init (Introduction to Git)
 
Version Control History and Git Basics
Version Control History and Git BasicsVersion Control History and Git Basics
Version Control History and Git Basics
 

Recently uploaded

HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesVictorSzoltysek
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfproinshot.com
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfryanfarris8
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024Mind IT Systems
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 

Recently uploaded (20)

HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 

Introduction to Version Control

Editor's Notes

  1. https://www.educba.com/git-alternatives/
  2. https://www.educba.com/git-alternatives/
  3. https://www.educba.com/git-alternatives/
  4. https://medium.com/redefyn/why-git-and-github-165de17e7c9d
  5. https://www.atlassian.com/git/tutorials/merging-vs-rebasing
  6. https://www.atlassian.com/git/tutorials/merging-vs-rebasing
  7. https://www.atlassian.com/git/tutorials/merging-vs-rebasing
  8. https://www.atlassian.com/git/tutorials/merging-vs-rebasing
  9. https://medium.com/@pakin/git-%E0%B8%97%E0%B8%B3%E0%B9%84%E0%B8%A1-commit-message-%E0%B8%96%E0%B8%B6%E0%B8%87%E0%B8%AA%E0%B8%B3%E0%B8%84%E0%B8%B1%E0%B8%8D-accdf82cbd82