SlideShare a Scribd company logo
VERSION CONTROL
AND GIT
Sreedevi Vedula
Terms used
• VCS – Version Control System
• Check-in – Storing files in the VCS Central Repo
• Check-out – Getting files from the VCS Central Repo
• Commit – Git’s term for check-in
What does version control do?
• Version files
• Manage changes from multiple users
• Store the versions in a central repository
Version Files
Version 1
Version 2
Version 1
Multi-User Check-in
Subsequent
Check-in at
9 A.M
Checkout
at 8 A.M.
Checkout
at 10
A.M.
Check-in
at 11 A.M.
VCS: “I
am
good”
Multi-User Check-in
Concurrent - Different Files
Check-in
at 9 A.M.
Check-out
at 8 A.M.
Check-out
at 8 A.M.
VCS: “I
am
good”
Check-in
at 9 A.M.
Multi-User Check-in
Concurrent – Same Files
Check-in at
9 A.M.
Check-out
at 8 A.M.
Modified lines:
Line 5
Line 6
Holiday.py
Modified lines:
Line 10
Line 11
Holiday.py
Merge
Check-in
at 10 A.M.
Check-out
at 8:30 A.M.
Multi-User Check-in
Concurrent – Same Files
9 A.M.
Merge
Conflict
Line 5
Line 6
Holiday.py
Line 5
Line 6
Holiday.py
10 A.M.
Check-out
at 8 A.M.
Check-out
at 8 A.M.
Take Snapshots of Repos
Release 1.0 Release 2.0
Create branches
Release 1.0
E-Fixes
Version 12 Version 13
Version 1 Version 2
Merge branches
Release 1.0
E-Fixes
Version 12 Version 13 Version 14
Release 2.0
Git – How is it different
• Repository is seen as a whole and not as files
• Commit a repo and not files
• Go back to a specific version of a repo and not a file
• Repository is local and not remote
• Entire repository can be accessed locally
• No need to be connected to the remote server
• Branches are also versions of the repo and not copies of it
• Create a new branches in the same filesystem
• Pull branches from remote server into the same filesystem
• Work on two branches simultaneously in the same file system
• Forking user repo is inherent
• Github server provides you option to fork your copy of the repo which
helps collaboration initiated from the user side
• Free github account to host experimental projects
Git Repository
• git init
• Creates a git local repository
• .git directory
• A hidden directory in the repository which has the repo information
like version history of all the files, branch information
• git clone <url>
• Download the remote repository at <url> and create a local
repository for it
Git – Working with files
• The four states for a file
• Untracked – The files that are not never added to git are in this stage
• Unmodified – Files that are in the git repo, but not edited.
• Modified – Files edited by you after getting changes from the repo
• Staged –Files that are staged for commit
• git add
• Moves untracked files / modified files to staged state
• git rm
• Move staged files to modified / untracked files
• git diff
• Show changes made to files in modified state
• git diff –cached
• Show changes made to files in staged state
• git commit
• Save changes to the local repository
• git checkout – <file>
• discard changes in working directory
• git reset
• Reset or revert to an earlier commit
• git log
• Show the commit history of the
Git – Working with branches
• git checkout –b
• Create a new branch and switch to it
• git branch
• List all the branches
• git merge <branch>
• Merge the current branch with the changes from <branch>
• git rebase <branch>
• Modify the development history of the current branch by pulling the
commits from it since the common latest commit <A> of the two
branches, apply the commit history of <branch> since <A> to the
latest commit to the current branch and re-apply the pulled-out
commits on top of it.
Git – Connecting with remotes
• User configuration
• Repo Level - .git/config
• Global Level - ~/.gitconfig
• System Level - /etc/gitconfig
• Know your git configuration
• git config
Git – working with remotes
• The three transfer protocols that help upload / download content from the remote
repositories
• Git
• Fastest Transfer
• No authentication
• SSH
• Authenticated Write access
• Efficient data transfer
• Encrypted data transfer
• Http
• Easy to setup
• Can serve read-only repos
• Corporate firewalls usually allow HTTP traffic
• Slow data transfer
• git clone <url>
• Creates a local repository for a remote repo given by <url>
• git remote add <remote-name> <url>
• Add a git remote specified by <remote-name> for the repo at <url>
• git pull <remote-name> <branch>
• Pull changes from the branch <branch> of remote repo mapped to <remote-name>
• git push <remote-name> <branch>
• Push changes to the branch <branch> of remote repo mapped to <remote-name>
References
• http://git-scm.com/book

More Related Content

PPTX
PDF
Git and git flow
PPTX
Git 101 for Beginners
KEY
Introduction to Git
PDF
Starting with Git & GitHub
KEY
Introduction To Git
PDF
Git-flow workflow and pull-requests
PDF
Introducing GitLab
Git and git flow
Git 101 for Beginners
Introduction to Git
Starting with Git & GitHub
Introduction To Git
Git-flow workflow and pull-requests
Introducing GitLab

What's hot (20)

ODP
Introduction to Version Control
PDF
CI/CD with Github Actions
PDF
svn 능력자를 위한 git 개념 가이드
PDF
Git Series. Episode 3. Git Flow and Github-Flow
PDF
Introduction to Git
PPTX
Implementation &amp; Comparison Of Rdma Over Ethernet
PPTX
Git branching strategies
PPTX
Git and git workflow best practice
PDF
Git training v10
PPTX
Github
PDF
git and github
PPTX
Jenkins CI
ODP
Introduction to Nginx
PPTX
Git in 10 minutes
PPTX
Version control system and Git
PDF
Git - An Introduction
PPTX
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
PPTX
Understanding GIT and Version Control
PPTX
Introduction to git and github
PPTX
Git Lab Introduction
Introduction to Version Control
CI/CD with Github Actions
svn 능력자를 위한 git 개념 가이드
Git Series. Episode 3. Git Flow and Github-Flow
Introduction to Git
Implementation &amp; Comparison Of Rdma Over Ethernet
Git branching strategies
Git and git workflow best practice
Git training v10
Github
git and github
Jenkins CI
Introduction to Nginx
Git in 10 minutes
Version control system and Git
Git - An Introduction
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Understanding GIT and Version Control
Introduction to git and github
Git Lab Introduction
Ad

Similar to Git (20)

PPTX
GIT INTRODUCTION
PPTX
Git and GitHub (1).pptx
PPTX
Source Control Using Git
PPTX
PPT
Git 101 - Crash Course in Version Control using Git
PDF
Introduction to Git and GitHub
PPTX
Git and Github workshop GDSC MLRITM
PDF
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
PPT
Introduction to Git
PPTX
Quick and easy way to get started with Git & GitHub
PPT
Git installation and configuration
PPT
Introduction to git
PPTX
GIT.pptx
PDF
PPTX
Git 101
PPTX
Git Basics for Software Version Management
PDF
Version Control With Subversion
PPTX
Git theory
PPTX
Git and Github
GIT INTRODUCTION
Git and GitHub (1).pptx
Source Control Using Git
Git 101 - Crash Course in Version Control using Git
Introduction to Git and GitHub
Git and Github workshop GDSC MLRITM
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Introduction to Git
Quick and easy way to get started with Git & GitHub
Git installation and configuration
Introduction to git
GIT.pptx
Git 101
Git Basics for Software Version Management
Version Control With Subversion
Git theory
Git and Github
Ad

Recently uploaded (20)

PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PPTX
L1 - Introduction to python Backend.pptx
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
top salesforce developer skills in 2025.pdf
PDF
System and Network Administration Chapter 2
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
ai tools demonstartion for schools and inter college
PDF
System and Network Administraation Chapter 3
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PPTX
Operating system designcfffgfgggggggvggggggggg
PPTX
Reimagine Home Health with the Power of Agentic AI​
VVF-Customer-Presentation2025-Ver1.9.pptx
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
L1 - Introduction to python Backend.pptx
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
top salesforce developer skills in 2025.pdf
System and Network Administration Chapter 2
How Creative Agencies Leverage Project Management Software.pdf
How to Migrate SBCGlobal Email to Yahoo Easily
Internet Downloader Manager (IDM) Crack 6.42 Build 41
ai tools demonstartion for schools and inter college
System and Network Administraation Chapter 3
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Upgrade and Innovation Strategies for SAP ERP Customers
How to Choose the Right IT Partner for Your Business in Malaysia
Operating system designcfffgfgggggggvggggggggg
Reimagine Home Health with the Power of Agentic AI​

Git

  • 2. Terms used • VCS – Version Control System • Check-in – Storing files in the VCS Central Repo • Check-out – Getting files from the VCS Central Repo • Commit – Git’s term for check-in
  • 3. What does version control do? • Version files • Manage changes from multiple users • Store the versions in a central repository
  • 5. Multi-User Check-in Subsequent Check-in at 9 A.M Checkout at 8 A.M. Checkout at 10 A.M. Check-in at 11 A.M. VCS: “I am good”
  • 6. Multi-User Check-in Concurrent - Different Files Check-in at 9 A.M. Check-out at 8 A.M. Check-out at 8 A.M. VCS: “I am good” Check-in at 9 A.M.
  • 7. Multi-User Check-in Concurrent – Same Files Check-in at 9 A.M. Check-out at 8 A.M. Modified lines: Line 5 Line 6 Holiday.py Modified lines: Line 10 Line 11 Holiday.py Merge Check-in at 10 A.M. Check-out at 8:30 A.M.
  • 8. Multi-User Check-in Concurrent – Same Files 9 A.M. Merge Conflict Line 5 Line 6 Holiday.py Line 5 Line 6 Holiday.py 10 A.M. Check-out at 8 A.M. Check-out at 8 A.M.
  • 9. Take Snapshots of Repos Release 1.0 Release 2.0
  • 10. Create branches Release 1.0 E-Fixes Version 12 Version 13 Version 1 Version 2
  • 11. Merge branches Release 1.0 E-Fixes Version 12 Version 13 Version 14 Release 2.0
  • 12. Git – How is it different • Repository is seen as a whole and not as files • Commit a repo and not files • Go back to a specific version of a repo and not a file • Repository is local and not remote • Entire repository can be accessed locally • No need to be connected to the remote server • Branches are also versions of the repo and not copies of it • Create a new branches in the same filesystem • Pull branches from remote server into the same filesystem • Work on two branches simultaneously in the same file system • Forking user repo is inherent • Github server provides you option to fork your copy of the repo which helps collaboration initiated from the user side • Free github account to host experimental projects
  • 13. Git Repository • git init • Creates a git local repository • .git directory • A hidden directory in the repository which has the repo information like version history of all the files, branch information • git clone <url> • Download the remote repository at <url> and create a local repository for it
  • 14. Git – Working with files • The four states for a file • Untracked – The files that are not never added to git are in this stage • Unmodified – Files that are in the git repo, but not edited. • Modified – Files edited by you after getting changes from the repo • Staged –Files that are staged for commit • git add • Moves untracked files / modified files to staged state • git rm • Move staged files to modified / untracked files • git diff • Show changes made to files in modified state • git diff –cached • Show changes made to files in staged state • git commit • Save changes to the local repository • git checkout – <file> • discard changes in working directory • git reset • Reset or revert to an earlier commit • git log • Show the commit history of the
  • 15. Git – Working with branches • git checkout –b • Create a new branch and switch to it • git branch • List all the branches • git merge <branch> • Merge the current branch with the changes from <branch> • git rebase <branch> • Modify the development history of the current branch by pulling the commits from it since the common latest commit <A> of the two branches, apply the commit history of <branch> since <A> to the latest commit to the current branch and re-apply the pulled-out commits on top of it.
  • 16. Git – Connecting with remotes • User configuration • Repo Level - .git/config • Global Level - ~/.gitconfig • System Level - /etc/gitconfig • Know your git configuration • git config
  • 17. Git – working with remotes • The three transfer protocols that help upload / download content from the remote repositories • Git • Fastest Transfer • No authentication • SSH • Authenticated Write access • Efficient data transfer • Encrypted data transfer • Http • Easy to setup • Can serve read-only repos • Corporate firewalls usually allow HTTP traffic • Slow data transfer • git clone <url> • Creates a local repository for a remote repo given by <url> • git remote add <remote-name> <url> • Add a git remote specified by <remote-name> for the repo at <url> • git pull <remote-name> <branch> • Pull changes from the branch <branch> of remote repo mapped to <remote-name> • git push <remote-name> <branch> • Push changes to the branch <branch> of remote repo mapped to <remote-name>