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

ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfLivetecs LLC
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noidabntitsolutionsrishis
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 

Recently uploaded (20)

ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdf
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 

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