SlideShare a Scribd company logo
2
Most read
6
Most read
15
Most read
Version
Control
Why?
Why?
Understanding GIT and Version Control
Getting Started
A version control system is a special application that stores and manages
every revision of your files and code. Many developers and organizations use
version control to collaborate on source code, manage releases, and roll back
to previous versions when bugs are discovered.
5
VCS
6
Benefits
7
•Backup and Restore
•Synchronization
•Short-term undo
•Long-term undo
•Track Changes
•Track Ownership
•Sandboxing
•Branching and
•merging
Installation & Setup
8
1. Git is a versioning system developed by Linus Torvalds, that is used by
millions of users around the globe. Companies like GitHub offer code hosting
services based on Git.
2. Run your own Git server
3. Git Client
4. https://git-scm.com/downloads
9
Basic Setup
Repository (repo): The database storing the files.
Server: The computer storing the repo.
Client: The computer connecting to the repo.
Working Set/Working Copy: Your local directory of files,
where you make changes.
Trunk/Main: The primary location for code in the repo.
Think of code as a family tree — the trunk is the main line.
Features
10
Add: Put a file into the repo for the first time, i.e. begin tracking it with
Version Control.
Revision: What version a file is on (v1, v2, v3, etc.).
Head: The latest revision in the repo.
Check out: Download a file from the repo.
Check in: Upload a file to the repository (if it has changed). The file
gets a new revision number, and people can “check out” the latest one.
Checkin Message: A short message describing what was
changed.
Changelog/History: A list of changes made to a file since it was
created.
11
Update/Sync: Synchronize your files with the latest from
the repository. This lets you grab the latest revisions of all
files.
Revert Throw away your local changes and reload
the latest version from the repository
Branch: Create a separate copy of a file/folder for
private use (bug fixing, testing, etc). Branch is both
a verb (“branch the code”) and a noun (“Which
branch is it in?”)
12
Diff/Change/Delta: Finding the differences between
two files. Useful for seeing what changed between revisions.
Merge (or patch): Apply the changes from one file to
another, to bring it up-to-date. For example, you can merge
features from one branch into another.
Conflict: When pending changes to a file contradict each
other (both changes cannot be applied).
13
Resolve: Fixing the changes that contradict each other
and checking in the correct version.
Locking: Taking control of a file so nobody else can edit
it until you unlock it. Some version control systems use
this to avoid conflicts.
Breaking the lock: Forcibly unlocking a file so you can edit
it. It may be needed if someone locks a file and goes on
vacation (or “calls in sick” the day Halo 3 comes out).
Check out for edit: Checking out an “editable” version of a
file. Some VCSes have editable files by default, others require
an explicit command.
14
Git Commands
15
1. Initializing a Git Repository
2.
git init
Repository Status
git status
3.Adding files to Repository
git add file [file] [file..]
Git Commands
16
4.Committing Staged Files
5.
git commit -m ‘Initial Commit’
Pushing to repository
git push
6.Check status
git status
Uploading the content to github
17
git remote add origin remote url.git
git push origin master
Cloning the repository
git clone remote url.git
18
Checking the difference on conflict
19
git diff
git revert HEAD
Reverting the version
Git pull
git checkout -b [name_of_your_new_branch]
git push origin [name_of_your_new_branch]
Create a branch
git branch -a
View all branches
Add remote to your branch
20
git remote add [name_of_your_remote] [name_of_your_new_branch]
git push --set-upstream origin branch_name
Push changes from your commit into your branch :
Git add .
git commit –m “message”
git push --set-upstream origin branch_name
Then Add commit and push
git branch -a
View all branches
Update your branch when the original branch from official
repository has been updated
21
git fetch [name_of_your_remote]
Then you need to apply to merge changes if your branch is
Git checkout master
git merge [name_of_your_branch]
Thanks

More Related Content

PDF
Git basics for beginners
PravallikaTammisetty
 
PPTX
Git commands
Viyaan Jhiingade
 
PDF
GIT | Distributed Version Control System
Mohammad Imam Hossain
 
PPTX
Git presentation
Sai Kumar Satapathy
 
PPTX
Introduction to git & GitHub
Poornachandrakashi
 
KEY
Introduction To Git
Arnaud Seilles
 
PDF
A Practical Introduction to git
Emanuele Olivetti
 
PPTX
Github basics
Radoslav Georgiev
 
Git basics for beginners
PravallikaTammisetty
 
Git commands
Viyaan Jhiingade
 
GIT | Distributed Version Control System
Mohammad Imam Hossain
 
Git presentation
Sai Kumar Satapathy
 
Introduction to git & GitHub
Poornachandrakashi
 
Introduction To Git
Arnaud Seilles
 
A Practical Introduction to git
Emanuele Olivetti
 
Github basics
Radoslav Georgiev
 

What's hot (20)

PDF
Github - Git Training Slides: Foundations
Lee Hanxue
 
PPT
Git basic
Emran Ul Hadi
 
PDF
Git training v10
Skander Hamza
 
PPTX
Introduction git
Dian Sigit Prastowo
 
PDF
Git and github 101
Senthilkumar Gopal
 
PPTX
Git basics to advance with diagrams
Dilum Navanjana
 
PPTX
Git 101 for Beginners
Anurag Upadhaya
 
PPTX
Git One Day Training Notes
glen_a_smith
 
PDF
Git - An Introduction
Behzad Altaf
 
PPTX
Git & GitLab
Gaurav Wable
 
PPTX
Intro to git and git hub
Venkat Malladi
 
PDF
Git and git flow
Fran García
 
PDF
Learning git
Sid Anand
 
PDF
Git & GitHub WorkShop
SheilaJimenezMorejon
 
PDF
Intro to Git and GitHub
Panagiotis Papadopoulos
 
PPTX
Introduction to Git and GitHub Part 1
Omar Fathy
 
PPTX
Git
Shinu Suresh
 
KEY
The everyday developer's guide to version control with Git
E Carter
 
PPTX
Grokking opensource with github
GoogleDeveloperStude4
 
PPTX
Git - Basic Crash Course
Nilay Binjola
 
Github - Git Training Slides: Foundations
Lee Hanxue
 
Git basic
Emran Ul Hadi
 
Git training v10
Skander Hamza
 
Introduction git
Dian Sigit Prastowo
 
Git and github 101
Senthilkumar Gopal
 
Git basics to advance with diagrams
Dilum Navanjana
 
Git 101 for Beginners
Anurag Upadhaya
 
Git One Day Training Notes
glen_a_smith
 
Git - An Introduction
Behzad Altaf
 
Git & GitLab
Gaurav Wable
 
Intro to git and git hub
Venkat Malladi
 
Git and git flow
Fran García
 
Learning git
Sid Anand
 
Git & GitHub WorkShop
SheilaJimenezMorejon
 
Intro to Git and GitHub
Panagiotis Papadopoulos
 
Introduction to Git and GitHub Part 1
Omar Fathy
 
The everyday developer's guide to version control with Git
E Carter
 
Grokking opensource with github
GoogleDeveloperStude4
 
Git - Basic Crash Course
Nilay Binjola
 
Ad

Similar to Understanding GIT and Version Control (20)

PPTX
Introduction to Version Control
RaksitMantanacharu
 
PPTX
github ppt git ppt on git hub to know ab
infoinnext
 
PPTX
Git walkthrough
Bimal Jain
 
PPTX
GIT INTRODUCTION
MohanRaviRohitth
 
PPTX
GIT In Detail
Haitham Raik
 
PPTX
GIT.pptx
Soumen Debgupta
 
PDF
git.ppt.pdf
Roniel Lopez Alvarez
 
PPTX
Version control
Saman Najafi
 
PPTX
Version Control Training - First Lego League
Jeffrey T. Pollock
 
PPTX
01 - Git vs SVN
Edward Goikhman
 
PDF
Git_tutorial.pdf
AliaaTarek5
 
PPTX
Git and github
Teodora Ahkozidou
 
PDF
Let's talk GIt
Darshan Parikh
 
KEY
Let's Git this Party Started: An Introduction to Git and GitHub
Kim Moir
 
PPTX
Git Overview
Mallikarjuna G D
 
PPTX
Techoalien git
Aditya Tiwari
 
PPTX
Techoalien git
Aditya Tiwari
 
PPTX
Techoalien git
Aditya Tiwari
 
PPTX
git.ppt.pptx power point presentation got Google internet
rani marri
 
Introduction to Version Control
RaksitMantanacharu
 
github ppt git ppt on git hub to know ab
infoinnext
 
Git walkthrough
Bimal Jain
 
GIT INTRODUCTION
MohanRaviRohitth
 
GIT In Detail
Haitham Raik
 
GIT.pptx
Soumen Debgupta
 
Version control
Saman Najafi
 
Version Control Training - First Lego League
Jeffrey T. Pollock
 
01 - Git vs SVN
Edward Goikhman
 
Git_tutorial.pdf
AliaaTarek5
 
Git and github
Teodora Ahkozidou
 
Let's talk GIt
Darshan Parikh
 
Let's Git this Party Started: An Introduction to Git and GitHub
Kim Moir
 
Git Overview
Mallikarjuna G D
 
Techoalien git
Aditya Tiwari
 
Techoalien git
Aditya Tiwari
 
Techoalien git
Aditya Tiwari
 
git.ppt.pptx power point presentation got Google internet
rani marri
 
Ad

More from Sourabh Sahu (20)

PPTX
Python Seaborn Data Visualization
Sourabh Sahu
 
PPTX
Mongo db Quick Guide
Sourabh Sahu
 
PPTX
Python Course
Sourabh Sahu
 
PPTX
Android styles and themes
Sourabh Sahu
 
PPT
SeekBar in Android
Sourabh Sahu
 
PPTX
Android layouts
Sourabh Sahu
 
PPT
Android ListView and Custom ListView
Sourabh Sahu
 
PPT
Activities
Sourabh Sahu
 
PPT
Android project architecture
Sourabh Sahu
 
PPT
Shared preferences
Sourabh Sahu
 
PPT
Content Providers in Android
Sourabh Sahu
 
PPT
SQLITE Android
Sourabh Sahu
 
PPT
Calendar, Clocks, DatePicker and TimePicker
Sourabh Sahu
 
PPT
Progress Dialog, AlertDialog, CustomDialog
Sourabh Sahu
 
PPT
AutocompleteTextView And MultiAutoCompleteTextView
Sourabh Sahu
 
PPT
Web view
Sourabh Sahu
 
PPT
Parceable serializable
Sourabh Sahu
 
PPT
Android Architecture
Sourabh Sahu
 
PPT
Android Installation Testing
Sourabh Sahu
 
PPT
Android Installation
Sourabh Sahu
 
Python Seaborn Data Visualization
Sourabh Sahu
 
Mongo db Quick Guide
Sourabh Sahu
 
Python Course
Sourabh Sahu
 
Android styles and themes
Sourabh Sahu
 
SeekBar in Android
Sourabh Sahu
 
Android layouts
Sourabh Sahu
 
Android ListView and Custom ListView
Sourabh Sahu
 
Activities
Sourabh Sahu
 
Android project architecture
Sourabh Sahu
 
Shared preferences
Sourabh Sahu
 
Content Providers in Android
Sourabh Sahu
 
SQLITE Android
Sourabh Sahu
 
Calendar, Clocks, DatePicker and TimePicker
Sourabh Sahu
 
Progress Dialog, AlertDialog, CustomDialog
Sourabh Sahu
 
AutocompleteTextView And MultiAutoCompleteTextView
Sourabh Sahu
 
Web view
Sourabh Sahu
 
Parceable serializable
Sourabh Sahu
 
Android Architecture
Sourabh Sahu
 
Android Installation Testing
Sourabh Sahu
 
Android Installation
Sourabh Sahu
 

Recently uploaded (20)

PDF
Wondershare Filmora 14.5.20.12999 Crack Full New Version 2025
gsgssg2211
 
PDF
Microsoft Teams Essentials; The pricing and the versions_PDF.pdf
Q-Advise
 
PDF
Appium Automation Testing Tutorial PDF: Learn Mobile Testing in 7 Days
jamescantor38
 
PPTX
Services offered by Dynamic Solutions in Pakistan
DaniyaalAdeemShibli1
 
PDF
Why Use Open Source Reporting Tools for Business Intelligence.pdf
Varsha Nayak
 
PDF
PFAS Reporting Requirements 2026 Are You Submission Ready Certivo.pdf
Certivo Inc
 
PPTX
Role Of Python In Programing Language.pptx
jaykoshti048
 
PPTX
oapresentation.pptx
mehatdhavalrajubhai
 
DOCX
The Five Best AI Cover Tools in 2025.docx
aivoicelabofficial
 
PDF
How to Seamlessly Integrate Salesforce Data Cloud with Marketing Cloud.pdf
NSIQINFOTECH
 
PDF
Multi-factor Authentication (MFA) requirement for Microsoft 365 Admin Center_...
Q-Advise
 
PPTX
Save Business Costs with CRM Software for Insurance Agents
Insurance Tech Services
 
PPTX
Explanation about Structures in C language.pptx
Veeral Rathod
 
PDF
Micromaid: A simple Mermaid-like chart generator for Pharo
ESUG
 
PDF
On Software Engineers' Productivity - Beyond Misleading Metrics
Romén Rodríguez-Gil
 
PPTX
TestNG for Java Testing and Automation testing
ssuser0213cb
 
PPTX
Odoo Integration Services by Candidroot Solutions
CandidRoot Solutions Private Limited
 
PDF
What to consider before purchasing Microsoft 365 Business Premium_PDF.pdf
Q-Advise
 
PPTX
Why Use Open Source Reporting Tools for Business Intelligence.pptx
Varsha Nayak
 
PDF
QAware_Mario-Leander_Reimer_Architecting and Building a K8s-based AI Platform...
QAware GmbH
 
Wondershare Filmora 14.5.20.12999 Crack Full New Version 2025
gsgssg2211
 
Microsoft Teams Essentials; The pricing and the versions_PDF.pdf
Q-Advise
 
Appium Automation Testing Tutorial PDF: Learn Mobile Testing in 7 Days
jamescantor38
 
Services offered by Dynamic Solutions in Pakistan
DaniyaalAdeemShibli1
 
Why Use Open Source Reporting Tools for Business Intelligence.pdf
Varsha Nayak
 
PFAS Reporting Requirements 2026 Are You Submission Ready Certivo.pdf
Certivo Inc
 
Role Of Python In Programing Language.pptx
jaykoshti048
 
oapresentation.pptx
mehatdhavalrajubhai
 
The Five Best AI Cover Tools in 2025.docx
aivoicelabofficial
 
How to Seamlessly Integrate Salesforce Data Cloud with Marketing Cloud.pdf
NSIQINFOTECH
 
Multi-factor Authentication (MFA) requirement for Microsoft 365 Admin Center_...
Q-Advise
 
Save Business Costs with CRM Software for Insurance Agents
Insurance Tech Services
 
Explanation about Structures in C language.pptx
Veeral Rathod
 
Micromaid: A simple Mermaid-like chart generator for Pharo
ESUG
 
On Software Engineers' Productivity - Beyond Misleading Metrics
Romén Rodríguez-Gil
 
TestNG for Java Testing and Automation testing
ssuser0213cb
 
Odoo Integration Services by Candidroot Solutions
CandidRoot Solutions Private Limited
 
What to consider before purchasing Microsoft 365 Business Premium_PDF.pdf
Q-Advise
 
Why Use Open Source Reporting Tools for Business Intelligence.pptx
Varsha Nayak
 
QAware_Mario-Leander_Reimer_Architecting and Building a K8s-based AI Platform...
QAware GmbH
 

Understanding GIT and Version Control

  • 5. Getting Started A version control system is a special application that stores and manages every revision of your files and code. Many developers and organizations use version control to collaborate on source code, manage releases, and roll back to previous versions when bugs are discovered. 5
  • 7. Benefits 7 •Backup and Restore •Synchronization •Short-term undo •Long-term undo •Track Changes •Track Ownership •Sandboxing •Branching and •merging
  • 8. Installation & Setup 8 1. Git is a versioning system developed by Linus Torvalds, that is used by millions of users around the globe. Companies like GitHub offer code hosting services based on Git. 2. Run your own Git server 3. Git Client 4. https://git-scm.com/downloads
  • 9. 9 Basic Setup Repository (repo): The database storing the files. Server: The computer storing the repo. Client: The computer connecting to the repo. Working Set/Working Copy: Your local directory of files, where you make changes. Trunk/Main: The primary location for code in the repo. Think of code as a family tree — the trunk is the main line.
  • 10. Features 10 Add: Put a file into the repo for the first time, i.e. begin tracking it with Version Control. Revision: What version a file is on (v1, v2, v3, etc.). Head: The latest revision in the repo. Check out: Download a file from the repo. Check in: Upload a file to the repository (if it has changed). The file gets a new revision number, and people can “check out” the latest one. Checkin Message: A short message describing what was changed. Changelog/History: A list of changes made to a file since it was created.
  • 11. 11 Update/Sync: Synchronize your files with the latest from the repository. This lets you grab the latest revisions of all files. Revert Throw away your local changes and reload the latest version from the repository Branch: Create a separate copy of a file/folder for private use (bug fixing, testing, etc). Branch is both a verb (“branch the code”) and a noun (“Which branch is it in?”)
  • 12. 12 Diff/Change/Delta: Finding the differences between two files. Useful for seeing what changed between revisions. Merge (or patch): Apply the changes from one file to another, to bring it up-to-date. For example, you can merge features from one branch into another. Conflict: When pending changes to a file contradict each other (both changes cannot be applied).
  • 13. 13 Resolve: Fixing the changes that contradict each other and checking in the correct version. Locking: Taking control of a file so nobody else can edit it until you unlock it. Some version control systems use this to avoid conflicts. Breaking the lock: Forcibly unlocking a file so you can edit it. It may be needed if someone locks a file and goes on vacation (or “calls in sick” the day Halo 3 comes out). Check out for edit: Checking out an “editable” version of a file. Some VCSes have editable files by default, others require an explicit command.
  • 14. 14
  • 15. Git Commands 15 1. Initializing a Git Repository 2. git init Repository Status git status 3.Adding files to Repository git add file [file] [file..]
  • 16. Git Commands 16 4.Committing Staged Files 5. git commit -m ‘Initial Commit’ Pushing to repository git push 6.Check status git status
  • 17. Uploading the content to github 17 git remote add origin remote url.git git push origin master Cloning the repository git clone remote url.git
  • 18. 18
  • 19. Checking the difference on conflict 19 git diff git revert HEAD Reverting the version Git pull git checkout -b [name_of_your_new_branch] git push origin [name_of_your_new_branch] Create a branch git branch -a View all branches
  • 20. Add remote to your branch 20 git remote add [name_of_your_remote] [name_of_your_new_branch] git push --set-upstream origin branch_name Push changes from your commit into your branch : Git add . git commit –m “message” git push --set-upstream origin branch_name Then Add commit and push git branch -a View all branches
  • 21. Update your branch when the original branch from official repository has been updated 21 git fetch [name_of_your_remote] Then you need to apply to merge changes if your branch is Git checkout master git merge [name_of_your_branch]