SlideShare a Scribd company logo
1 of 45
Programming workshop
5:15 pm
Version Control Systems
Part I
JetBrains student program
Pycharm
jetbrains.com/pycharm
jetbrains.com/student
Intellij IDEA
jetbrains.com/idea
PhpStorm
jetbrains.com/phpstorm
And the list goes on…
PRO Git v2
https://git-scm.com/book/en/v2
Graphical content in this demonstration in partial is taken
from PRO Git v2 book.
Version control
Version control is a system that records changes to a
file or set of files over time so that you can recall
specific versions later.
Version control
Version control is a system that records changes to a
file or set of files over time so that you can recall
specific versions later.
Dummy version control
copy files into another directory
(perhaps a time-stamped directory, if they’re clever).
Dummy version control
copy files into another directory
(perhaps a time-stamped directory, if they’re clever).
It is easy to forget which directory you’re in and accidentally write to the wrong file
or copy over files you don’t mean to.
Local version control
Centralized version control (CVCS)
Centralized version control (CVCS)
Usual suspects:
• CVS
• Subversion
• Perforce
Advantages:
• everyone knows to a certain degree what everyone else on the project is doing
• administrators have fine-grained control over who can do what
• it is far easier to administer a CVCS than it is to deal with local databases on every client
Centralized version control (CVCS)
Disadvantages:
• Single point of failure (If the main server goes down the developers can’t save versioned
change)
• Remote commits are slow
• Unsolicited changes might ruin the development
• Single point of failure (if the hard disk of the central databse becomes corrupted the entire
history could be lost)
• No easy way to go from single-developer to multipl-developer state
Distributed version control (DVCS)
Distributed version control (DVCS)
Usual suspects:
• Git
• Mercurial
• Bazaar
Advantages:
• Full history is available to everyone at all times
• Extemely fast due to local nature of the majority of the operation
• No access to remote server is required
• Sharing can be done among any subset of developers, before making changes public
• Branching and merging is SUPER easy
Distributed version control (DVCS)
Disadvantages:
• Large number of files that can not be easily compressed may be an issue
• Very long project history may result in a rather long initial download
Git
Date of birth: 2005
Creator: Linus Torvalds
Requirements:
• Speed
• Simple design
• Strong support fo non-linear development (thoudands of paraller branches)
• Fully distributed
• Large projects support
Git: snapshots, not differences
Git: snapshots, not differences
Git
•Filesystem on steroids
Git
•Filesystem on steroids
•Almost every operation is local
Git
•Filesystem on steroids
•Almost every operation is local
•Integrity
•Only adding data throughout time
Git: project structure
Git: basic workflow
1. Checkout a revision to work on from repository
2. Modify files in working directory
3.* Add modified files into the staging area as you go
4. Commit you staged files into the repository
Git: files status lifecycle
Git: files status lifecycle
>>> git add file_name
Git: files status lifecycle
>>> git add file_name
Git: files status lifecycle
>>> git rm file_name
Git: files status lifecycle
>>> git commit
>>> git commit –m “commit message”
>>> git commit –F commit_file
>>> git commit –a
>>> git commit file_name1 file_name2
Git: branch
Git: branches
Git: branches
>>> git branch iss53
>>> git checkout iss53
>>> git checkout -b iss53
do some work in iss53
Git: branches
do some work in iss53
Git: branches
do some work in iss53
>>> git checkout master
>>> git checkout –b hotfix
do some work in hotfix
Git: branches
merge master with hotfix
>>> git checkout master
>>> git merge hotfix
Git: branches
delete hotfix branch
>>> git branch –d hotfix
>>> git checkout iss53
do some work in iss53
Git: branches
>>> git checkout master
>>> git merge iss53
Git: branches
Git: collaborating
Git: remotes
Adding a remote:
>>> git remote add github https://github.com/aganezov/vcs-sample.git
>>> git remote
github
>>> git remote –v
github https://github.com/aganezov/vcs-sample.git (fetch)
github https://github.com/aganezov/vcs-sample.git (push)
Git: remotes
Remote branches are references of states of branches on your remote
repository.
You can think of them as local branches that you can not move. They are
mvoed automatically due to network communication.
They take form of (remote)/(branch)
>>> git remote
Git: remotes
Git: remotes
• >>> git push github master [--set-upstream]
• >>> git push
• >>> git fetch
updates the (remote)/(branch) pointers for you repository
• >>> git pull
>>> git fetch
>>> git merge
merges remote tracked branch into current one
Git: remotes
Git: remotes
Takeaways:
• VCS can save you from really bad things
• Version Control Systems are easy to use
• Git is easy to use
• Every Git revision is the snapshot of the entire project state!
• Git branch is a simple pointer to a revision
• Git remote branch is another simple pointer
• You are where the HEAD is
• Branching and merging is super easy
• Github / Bitbucket are good free Git remote server options
Next JetBrains GWU meeting
“VCS – Git – Part II”
December 17, 5:00 – 7:00 pm SEH room 2000
Facebook
https://www.facebook.com/groups/jetbrains.gwu/
Twitter
https://twitter.com/JetBrains_GWU
Email
jetbrains.gwu@gmail.com
aganezov@gwu.edu

More Related Content

What's hot

Version control system
Version control systemVersion control system
Version control systemAryman Gautam
 
Version control
Version controlVersion control
Version controlvisual28
 
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 GitE Carter
 
Git Introduction Tutorial
Git Introduction TutorialGit Introduction Tutorial
Git Introduction TutorialThomas Rausch
 
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
 
Advanced Git: Functionality and Features
Advanced Git: Functionality and FeaturesAdvanced Git: Functionality and Features
Advanced Git: Functionality and FeaturesBrent Laster
 
Open Source Collaboration With Git And Git Hub
Open Source Collaboration With Git And Git HubOpen Source Collaboration With Git And Git Hub
Open Source Collaboration With Git And Git HubNick Quaranto
 
Github - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsGithub - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsLee Hanxue
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notesglen_a_smith
 
SCM (Source Control Management) - Git Basic
SCM (Source Control Management) - Git Basic SCM (Source Control Management) - Git Basic
SCM (Source Control Management) - Git Basic Aman Patial
 
Introduction to Git for developers
Introduction to Git for developersIntroduction to Git for developers
Introduction to Git for developersDmitry Guyvoronsky
 
Beginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitBeginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitRobert Lee-Cann
 
Version control and GIT Primer
Version control and GIT PrimerVersion control and GIT Primer
Version control and GIT Primersaadulde
 
2017 jenkins world
2017 jenkins world2017 jenkins world
2017 jenkins worldBrent Laster
 
BLUG 2012 Version Control for Notes Developers
BLUG 2012 Version Control for Notes DevelopersBLUG 2012 Version Control for Notes Developers
BLUG 2012 Version Control for Notes DevelopersMartin Jinoch
 

What's hot (20)

Webinar : SVN to GIT Migration
Webinar : SVN to GIT Migration Webinar : SVN to GIT Migration
Webinar : SVN to GIT Migration
 
Version control system
Version control systemVersion control system
Version control system
 
Version control
Version controlVersion control
Version control
 
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
 
Git Introduction Tutorial
Git Introduction TutorialGit Introduction Tutorial
Git Introduction Tutorial
 
Version Control History and Git Basics
Version Control History and Git BasicsVersion Control History and Git Basics
Version Control History and Git Basics
 
Advanced Git: Functionality and Features
Advanced Git: Functionality and FeaturesAdvanced Git: Functionality and Features
Advanced Git: Functionality and Features
 
Open Source Collaboration With Git And Git Hub
Open Source Collaboration With Git And Git HubOpen Source Collaboration With Git And Git Hub
Open Source Collaboration With Git And Git Hub
 
Github - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsGithub - Git Training Slides: Foundations
Github - Git Training Slides: Foundations
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notes
 
Git tutorial
Git tutorialGit tutorial
Git tutorial
 
SCM (Source Control Management) - Git Basic
SCM (Source Control Management) - Git Basic SCM (Source Control Management) - Git Basic
SCM (Source Control Management) - Git Basic
 
Git 101
Git 101Git 101
Git 101
 
Introduction to Git for developers
Introduction to Git for developersIntroduction to Git for developers
Introduction to Git for developers
 
Git & Github for beginners
Git & Github for beginnersGit & Github for beginners
Git & Github for beginners
 
Beginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitBeginner's Guide to Version Control with Git
Beginner's Guide to Version Control with Git
 
Version control and GIT Primer
Version control and GIT PrimerVersion control and GIT Primer
Version control and GIT Primer
 
Git from SVN
Git from SVNGit from SVN
Git from SVN
 
2017 jenkins world
2017 jenkins world2017 jenkins world
2017 jenkins world
 
BLUG 2012 Version Control for Notes Developers
BLUG 2012 Version Control for Notes DevelopersBLUG 2012 Version Control for Notes Developers
BLUG 2012 Version Control for Notes Developers
 

Similar to Version Control Systems -- Git -- Part I

Similar to Version Control Systems -- Git -- Part I (20)

Version Control with Git
Version Control with GitVersion Control with Git
Version Control with Git
 
Mini-training: Let’s Git It!
Mini-training: Let’s Git It!Mini-training: Let’s Git It!
Mini-training: Let’s Git It!
 
Git_tutorial.pdf
Git_tutorial.pdfGit_tutorial.pdf
Git_tutorial.pdf
 
CSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GITCSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GIT
 
Introduction to GitHub, Open Source and Tech Article
Introduction to GitHub, Open Source and Tech ArticleIntroduction to GitHub, Open Source and Tech Article
Introduction to GitHub, Open Source and Tech Article
 
Git hub
Git hubGit hub
Git hub
 
Introduction to Git and Github
Introduction to Git and Github Introduction to Git and Github
Introduction to Git and Github
 
Git introduction
Git introductionGit introduction
Git introduction
 
Git Training
Git TrainingGit Training
Git Training
 
Version control with GIT
Version control with GITVersion control with GIT
Version control with GIT
 
GIT_Overview.
GIT_Overview.GIT_Overview.
GIT_Overview.
 
Luis atencio on_git
Luis atencio on_gitLuis atencio on_git
Luis atencio on_git
 
GIT.pptx
GIT.pptxGIT.pptx
GIT.pptx
 
1-Intro to VC & GIT PDF.pptx
1-Intro to VC & GIT PDF.pptx1-Intro to VC & GIT PDF.pptx
1-Intro to VC & GIT PDF.pptx
 
Git - An Introduction
Git - An IntroductionGit - An Introduction
Git - An Introduction
 
Introduction to Git and GitHub
Introduction to Git and GitHubIntroduction to Git and GitHub
Introduction to Git and GitHub
 
Git training (basic)
Git training (basic)Git training (basic)
Git training (basic)
 
git.ppt.pdf
git.ppt.pdfgit.ppt.pdf
git.ppt.pdf
 
Git
GitGit
Git
 
Presentation on Repository Control System
Presentation on Repository Control SystemPresentation on Repository Control System
Presentation on Repository Control System
 

Recently uploaded

Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
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
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...masabamasaba
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in sowetomasabamasaba
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...chiefasafspells
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...masabamasaba
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park masabamasaba
 
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
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park masabamasaba
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...masabamasaba
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...Jittipong Loespradit
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Hararemasabamasaba
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is insideshinachiaurasa2
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfkalichargn70th171
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 

Recently uploaded (20)

Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
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
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
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
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 

Version Control Systems -- Git -- Part I

  • 1. Programming workshop 5:15 pm Version Control Systems Part I
  • 2. JetBrains student program Pycharm jetbrains.com/pycharm jetbrains.com/student Intellij IDEA jetbrains.com/idea PhpStorm jetbrains.com/phpstorm And the list goes on…
  • 3. PRO Git v2 https://git-scm.com/book/en/v2 Graphical content in this demonstration in partial is taken from PRO Git v2 book.
  • 4. Version control Version control is a system that records changes to a file or set of files over time so that you can recall specific versions later.
  • 5. Version control Version control is a system that records changes to a file or set of files over time so that you can recall specific versions later.
  • 6. Dummy version control copy files into another directory (perhaps a time-stamped directory, if they’re clever).
  • 7. Dummy version control copy files into another directory (perhaps a time-stamped directory, if they’re clever). It is easy to forget which directory you’re in and accidentally write to the wrong file or copy over files you don’t mean to.
  • 10. Centralized version control (CVCS) Usual suspects: • CVS • Subversion • Perforce Advantages: • everyone knows to a certain degree what everyone else on the project is doing • administrators have fine-grained control over who can do what • it is far easier to administer a CVCS than it is to deal with local databases on every client
  • 11. Centralized version control (CVCS) Disadvantages: • Single point of failure (If the main server goes down the developers can’t save versioned change) • Remote commits are slow • Unsolicited changes might ruin the development • Single point of failure (if the hard disk of the central databse becomes corrupted the entire history could be lost) • No easy way to go from single-developer to multipl-developer state
  • 13. Distributed version control (DVCS) Usual suspects: • Git • Mercurial • Bazaar Advantages: • Full history is available to everyone at all times • Extemely fast due to local nature of the majority of the operation • No access to remote server is required • Sharing can be done among any subset of developers, before making changes public • Branching and merging is SUPER easy
  • 14. Distributed version control (DVCS) Disadvantages: • Large number of files that can not be easily compressed may be an issue • Very long project history may result in a rather long initial download
  • 15. Git Date of birth: 2005 Creator: Linus Torvalds Requirements: • Speed • Simple design • Strong support fo non-linear development (thoudands of paraller branches) • Fully distributed • Large projects support
  • 16. Git: snapshots, not differences
  • 17. Git: snapshots, not differences
  • 19. Git •Filesystem on steroids •Almost every operation is local
  • 20. Git •Filesystem on steroids •Almost every operation is local •Integrity •Only adding data throughout time
  • 22. Git: basic workflow 1. Checkout a revision to work on from repository 2. Modify files in working directory 3.* Add modified files into the staging area as you go 4. Commit you staged files into the repository
  • 23. Git: files status lifecycle
  • 24. Git: files status lifecycle >>> git add file_name
  • 25. Git: files status lifecycle >>> git add file_name
  • 26. Git: files status lifecycle >>> git rm file_name
  • 27. Git: files status lifecycle >>> git commit >>> git commit –m “commit message” >>> git commit –F commit_file >>> git commit –a >>> git commit file_name1 file_name2
  • 30. Git: branches >>> git branch iss53 >>> git checkout iss53 >>> git checkout -b iss53 do some work in iss53
  • 31. Git: branches do some work in iss53
  • 32. Git: branches do some work in iss53 >>> git checkout master >>> git checkout –b hotfix do some work in hotfix
  • 33. Git: branches merge master with hotfix >>> git checkout master >>> git merge hotfix
  • 34. Git: branches delete hotfix branch >>> git branch –d hotfix >>> git checkout iss53 do some work in iss53
  • 35. Git: branches >>> git checkout master >>> git merge iss53
  • 38. Git: remotes Adding a remote: >>> git remote add github https://github.com/aganezov/vcs-sample.git >>> git remote github >>> git remote –v github https://github.com/aganezov/vcs-sample.git (fetch) github https://github.com/aganezov/vcs-sample.git (push)
  • 39. Git: remotes Remote branches are references of states of branches on your remote repository. You can think of them as local branches that you can not move. They are mvoed automatically due to network communication. They take form of (remote)/(branch) >>> git remote
  • 41. Git: remotes • >>> git push github master [--set-upstream] • >>> git push • >>> git fetch updates the (remote)/(branch) pointers for you repository • >>> git pull >>> git fetch >>> git merge merges remote tracked branch into current one
  • 44. Takeaways: • VCS can save you from really bad things • Version Control Systems are easy to use • Git is easy to use • Every Git revision is the snapshot of the entire project state! • Git branch is a simple pointer to a revision • Git remote branch is another simple pointer • You are where the HEAD is • Branching and merging is super easy • Github / Bitbucket are good free Git remote server options
  • 45. Next JetBrains GWU meeting “VCS – Git – Part II” December 17, 5:00 – 7:00 pm SEH room 2000 Facebook https://www.facebook.com/groups/jetbrains.gwu/ Twitter https://twitter.com/JetBrains_GWU Email jetbrains.gwu@gmail.com aganezov@gwu.edu