SlideShare ist ein Scribd-Unternehmen logo
1 von 58
Git The fast version control system Jeroen Rosenberg jeroen.rosenberg@gmail.com
Table of contents Short introduction to version control Version control systems Comparison with subversion Distributed version control Git usage Basic operations Solving conflicts Branching as a core concept Tooling Conclusion Git - the fast version control system
Version control Short introduction Git - the fast version control system
Version control (1) The management of changes to documents, programs, and other information stored as computer files A system that maintains versions of files at progressive stages of development. Every file Has a full history of changes Can be restored to any version A communication tool, like email, but with code rather than human conversation Git - the fast version control system
Version control (2) Benefits Git - the fast version control system
Version control (2) Benefits Allows a team to share code Git - the fast version control system
Version control (2) Benefits Allows a team to share code Maintains separate “production” versions of code that are always deployable Git - the fast version control system
Version control (2) Benefits Allows a team to share code Maintains separate “production” versions of code that are always deployable Allows simultaneous development of different features on the same codebase Git - the fast version control system
Version control (2) Benefits Allows a team to share code Maintains separate “production” versions of code that are always deployable Allows simultaneous development of different features on the same codebase Keeps track of all old versions of files Git - the fast version control system
Version control (2) Benefits Allows a team to share code Maintains separate “production” versions of code that are always deployable Allows simultaneous development of different features on the same codebase Keeps track of all old versions of files Prevents work being overwritten Git - the fast version control system
Glossary Some commonly used terms explained before moving on Git - the fast version control system
Key terms in version control Branch acopy of a set of files under version control which may be developed at different speeds or in different ways Checkout to copy the latest version of (a file in) the repository to your working copy Commit to copy (a file in) your working copy back into the repository as a new version   Merge to combine multiple changes made to different working copies of the same files in the repository Repository a (shared) database with the complete revision history of all files under version control Trunk the unique line of development that is not a branch Update to retrieve and integrate changes in the repository since the update. Working copy your local copies of the files under version control you want to edit Git - the fast version control system
Version control systems Git - the fast version control system
Very limited and inflexible Concurrent Versions System (CVS) Git - the fast version control system
Very limited and inflexible Concurrent Versions System (CVS) Fills most of the holes found in CVS, but added nothing to its development model  Subversion (SVN) Git - the fast version control system
Very limited and inflexible Concurrent Versions System (CVS) Fills most of the holes found in CVS, but added nothing to its development model  Subversion (SVN) More feature rich and functional Git Git - the fast version control system
Comparison with SVN Subversion Git Git - the fast version control system
Comparison with SVN Subversion Centralized Git Distributed Git - the fast version control system
Comparison with SVN Subversion Centralized Branching can be a pain and is used sparingly Git Distributed Branching is very easy and is a core concept Git - the fast version control system
Comparison with SVN Subversion Centralized Branching can be a pain and is used sparingly Conflicts frequently occur and renaming is not handled well Git Distributed Branching is very easy and is a core concept Conflicts occur less frequent, renaming is properly handled Git - the fast version control system
Comparison with SVN Subversion Centralized Branching can be a pain and is used sparingly Conflicts frequently occur and renaming is not handled well Can be slow due to network latency Git Distributed Branching is very easy and is a core concept Conflicts occur less frequent, renaming is properly handled Very fast since less operations involve network latency Git - the fast version control system
Comparison with SVN Subversion Centralized Branching can be a pain and is used sparingly Conflicts frequently occur and renaming is not handled well Can be slow due to network latency Can consume quite some disk space Git Distributed Branching is very easy and is a core concept Conflicts occur less frequent, renaming is properly handled Very fast since less operations involve network latency Consumes 30 times less disk space Git - the fast version control system
Distributed version control  The new generation of version control Git - the fast version control system
A basic, centralized version control system Users commit changes to the central repository and a new version is born to be checked out by other users Git - the fast version control system
A distributed version control system Each user has a full local copy of the repository. Users commit changes and when they want to share it, the push it to the shared repository  Git - the fast version control system
Git usage Basic operations Git - the fast version control system
Tracking a project.. Git - the fast version control system
Tracking a project.. Mirror the central server Anything the main repository can do, you can do! Git - the fast version control system
Tracking a project.. My project is tiny - git is overkill “Why would I carry a Swiss knife when I only want to open cans?” Git - the fast version control system
Tracking a project.. Tiny projects should be scalable too! “You wouldn’t use Roman digits just because you perform calculations with small numbers, now would you?” Tiny projects may grow beyond your expectations “One day you’ll desperately need that hex wrench and you’re stuck with your plain can-opener” Git - the fast version control system
Tracking a project.. Pretty straightforwarded, huh? Git - the fast version control system
Advanced committing… What if you screw up? #re-edit the metadata and update the tree $ git commit --amend or # toss your latest commit away without changing the working tree $ git reset HEAD^  Git - the fast version control system
Solving conflicts Instant merging Git - the fast version control system
Closer look at pulling.. Git - the fast version control system
Auto-merging.. What actually happens… # Fetch latest changes from origin $ git fetch # Merge fetched changes into current branch $ git merge refs/heads/master Git - the fast version control system
Auto-merging.. What actually happens… Recursive merge strategy – create a merged reference tree of common ancestors for three-way merge  ,[object Object]
 can detect and handle renamesGit - the fast version control system
Resolving conflicts.. Suppose Jeff and Dan both made changes to the same line in file… CONFLICT (content): Merge conflict in file Automatic merge failed; fix conflicts and then commit the result. Uh oh…. now what? Git - the fast version control system
Resolving conflicts.. Well, just merge manually… # run your favourite file merge application $ git mergetool –t opendiff Git - the fast version control system
Git - the fast version control system source: http://gitguru.com
Resolving conflicts.. …and commit! # commit to resolve the conflict $ git commit Git - the fast version control system
Branching A core concept Git - the fast version control system
Creating a branch.. Git - the fast version control system
Creating a branch.. Or create and switch to a branch based on another branch $ git checkout –b new_branch other_branch Git - the fast version control system
Some common scenarios… Git - the fast version control system Why would I require branching?
Scenario 1 – Interrupted workflow You’re finished with part 1 of a new feature but you can’t continue with part 2 before part 1 is released and tested   Git - the fast version control system
Scenario 1 – Interrupted workflow You’re finished with part 1 of a new feature but you can’t continue with part 2 before part 1 is released and tested   Git - the fast version control system
Scenario 2 – Quick fixes While you’re busy implementing some feature suddenly you’re being told to drop everything and fix a newly discovered bug Git - the fast version control system
Scenario 2 – Quick fixes While you’re busy implementing some feature suddenly you’re being told to drop everything and fix a newly discovered bug Git - the fast version control system
Git usage overview Just to summarize… Git - the fast version control system
Git command sequence Source: http://git.or.cz Git - the fast version control system
Tooling Stuck at ‘Ye Olde Terminal’? Not necessarily… Git - the fast version control system
Git UI front-ends Git - the fast version control system
[object Object],Git - the fast version control system Finder extension
[object Object],Git - the fast version control system Finder extension ,[object Object]
 Git ExtensionsWindows Explorer extensions
[object Object],Git - the fast version control system Finder extension ,[object Object]
 Git ExtensionsWindows Explorer extensions ,[object Object],Eclipse integration

Weitere ähnliche Inhalte

Was ist angesagt?

Version Control System
Version Control SystemVersion Control System
Version Control Systemguptaanil
 
Git and git workflow best practice
Git and git workflow best practiceGit and git workflow best practice
Git and git workflow best practiceMajid Hosseini
 
Git branching strategies
Git branching strategiesGit branching strategies
Git branching strategiesjstack
 
Git - Basic Crash Course
Git - Basic Crash CourseGit - Basic Crash Course
Git - Basic Crash CourseNilay Binjola
 
Git workflows presentation
Git workflows presentationGit workflows presentation
Git workflows presentationMack Hardy
 
Branching and merging strategy
Branching and merging strategyBranching and merging strategy
Branching and merging strategyRahul Janghel
 
GIT | Distributed Version Control System
GIT | Distributed Version Control SystemGIT | Distributed Version Control System
GIT | Distributed Version Control SystemMohammad Imam Hossain
 
Learning git
Learning gitLearning git
Learning gitSid Anand
 
Git flow Introduction
Git flow IntroductionGit flow Introduction
Git flow IntroductionDavid Paluy
 
Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners HubSpot
 
Introducing GitLab (June 2018)
Introducing GitLab (June 2018)Introducing GitLab (June 2018)
Introducing GitLab (June 2018)Noa Harel
 
Introduction to Git and GitHub
Introduction to Git and GitHubIntroduction to Git and GitHub
Introduction to Git and GitHubVikram SV
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notesglen_a_smith
 
A successful Git branching model
A successful Git branching model A successful Git branching model
A successful Git branching model abodeltae
 

Was ist angesagt? (20)

Version Control System
Version Control SystemVersion Control System
Version Control System
 
Git and git workflow best practice
Git and git workflow best practiceGit and git workflow best practice
Git and git workflow best practice
 
Git branching strategies
Git branching strategiesGit branching strategies
Git branching strategies
 
Git - Basic Crash Course
Git - Basic Crash CourseGit - Basic Crash Course
Git - Basic Crash Course
 
Git workflows presentation
Git workflows presentationGit workflows presentation
Git workflows presentation
 
Introduction git
Introduction gitIntroduction git
Introduction git
 
Git for beginners
Git for beginnersGit for beginners
Git for beginners
 
Branching and merging strategy
Branching and merging strategyBranching and merging strategy
Branching and merging strategy
 
GIT | Distributed Version Control System
GIT | Distributed Version Control SystemGIT | Distributed Version Control System
GIT | Distributed Version Control System
 
Learning git
Learning gitLearning git
Learning git
 
Git and github 101
Git and github 101Git and github 101
Git and github 101
 
Source control
Source controlSource control
Source control
 
Git flow Introduction
Git flow IntroductionGit flow Introduction
Git flow Introduction
 
Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners
 
Introducing GitLab (June 2018)
Introducing GitLab (June 2018)Introducing GitLab (June 2018)
Introducing GitLab (June 2018)
 
Introduction to Git and GitHub
Introduction to Git and GitHubIntroduction to Git and GitHub
Introduction to Git and GitHub
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notes
 
A successful Git branching model
A successful Git branching model A successful Git branching model
A successful Git branching model
 
Git real slides
Git real slidesGit real slides
Git real slides
 
Git in 10 minutes
Git in 10 minutesGit in 10 minutes
Git in 10 minutes
 

Ähnlich wie Git the fast version control system

Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...Simplilearn
 
Git usage (Basics and workflow)
Git usage (Basics and workflow)Git usage (Basics and workflow)
Git usage (Basics and workflow)Yeasin Abedin
 
Version Control with Git
Version Control with GitVersion Control with Git
Version Control with GitSahil Agarwal
 
02-version control(DevOps Series)
02-version control(DevOps Series)02-version control(DevOps Series)
02-version control(DevOps Series)Mohammed Shaban
 
Git essential training & sharing self
Git essential training & sharing selfGit essential training & sharing self
Git essential training & sharing selfChen-Tien Tsai
 
Version Control Systems -- Git -- Part I
Version Control Systems -- Git -- Part IVersion Control Systems -- Git -- Part I
Version Control Systems -- Git -- Part ISergey Aganezov
 
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 ArticlePRIYATHAMDARISI
 
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
 

Ähnlich wie Git the fast version control system (20)

Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
 
Git usage (Basics and workflow)
Git usage (Basics and workflow)Git usage (Basics and workflow)
Git usage (Basics and workflow)
 
GIT_Overview.
GIT_Overview.GIT_Overview.
GIT_Overview.
 
Git Tutorial
Git Tutorial Git Tutorial
Git Tutorial
 
Version Control with Git
Version Control with GitVersion Control with Git
Version Control with Git
 
Git 101
Git 101Git 101
Git 101
 
Git Demo
Git DemoGit Demo
Git Demo
 
Git hub_pptx
Git hub_pptxGit hub_pptx
Git hub_pptx
 
02-version control(DevOps Series)
02-version control(DevOps Series)02-version control(DevOps Series)
02-version control(DevOps Series)
 
Git session 1
Git session 1Git session 1
Git session 1
 
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 essential training & sharing self
Git essential training & sharing selfGit essential training & sharing self
Git essential training & sharing self
 
Version Control Systems -- Git -- Part I
Version Control Systems -- Git -- Part IVersion Control Systems -- Git -- Part I
Version Control Systems -- Git -- Part I
 
GIT By Sivakrishna
GIT By SivakrishnaGIT By Sivakrishna
GIT By Sivakrishna
 
git2.ppt
git2.pptgit2.ppt
git2.ppt
 
Overview of git
Overview of gitOverview of git
Overview of git
 
Overview of git
Overview of gitOverview of git
Overview of 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
 
Introduction to git & GitHub
Introduction to git & GitHubIntroduction to git & GitHub
Introduction to git & GitHub
 
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
 

Mehr von Jeroen Rosenberg

Cooking your Ravioli "al dente" with Hexagonal Architecture
Cooking your Ravioli "al dente" with Hexagonal ArchitectureCooking your Ravioli "al dente" with Hexagonal Architecture
Cooking your Ravioli "al dente" with Hexagonal ArchitectureJeroen Rosenberg
 
Apache Solr lessons learned
Apache Solr lessons learnedApache Solr lessons learned
Apache Solr lessons learnedJeroen Rosenberg
 
Provisioning with Vagrant & Puppet
Provisioning with Vagrant & PuppetProvisioning with Vagrant & Puppet
Provisioning with Vagrant & PuppetJeroen Rosenberg
 
Dynamic System Configuration using SOA
Dynamic System Configuration using SOADynamic System Configuration using SOA
Dynamic System Configuration using SOAJeroen Rosenberg
 
Dynamic Lighting with OpenGL
Dynamic Lighting with OpenGLDynamic Lighting with OpenGL
Dynamic Lighting with OpenGLJeroen Rosenberg
 

Mehr von Jeroen Rosenberg (8)

Cooking your Ravioli "al dente" with Hexagonal Architecture
Cooking your Ravioli "al dente" with Hexagonal ArchitectureCooking your Ravioli "al dente" with Hexagonal Architecture
Cooking your Ravioli "al dente" with Hexagonal Architecture
 
Apache Solr lessons learned
Apache Solr lessons learnedApache Solr lessons learned
Apache Solr lessons learned
 
CoffeeScript
CoffeeScriptCoffeeScript
CoffeeScript
 
Websocket on Rails
Websocket on RailsWebsocket on Rails
Websocket on Rails
 
Provisioning with Vagrant & Puppet
Provisioning with Vagrant & PuppetProvisioning with Vagrant & Puppet
Provisioning with Vagrant & Puppet
 
Spring AOP
Spring AOPSpring AOP
Spring AOP
 
Dynamic System Configuration using SOA
Dynamic System Configuration using SOADynamic System Configuration using SOA
Dynamic System Configuration using SOA
 
Dynamic Lighting with OpenGL
Dynamic Lighting with OpenGLDynamic Lighting with OpenGL
Dynamic Lighting with OpenGL
 

Kürzlich hochgeladen

Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 

Kürzlich hochgeladen (20)

Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 

Git the fast version control system

  • 1. Git The fast version control system Jeroen Rosenberg jeroen.rosenberg@gmail.com
  • 2. Table of contents Short introduction to version control Version control systems Comparison with subversion Distributed version control Git usage Basic operations Solving conflicts Branching as a core concept Tooling Conclusion Git - the fast version control system
  • 3. Version control Short introduction Git - the fast version control system
  • 4. Version control (1) The management of changes to documents, programs, and other information stored as computer files A system that maintains versions of files at progressive stages of development. Every file Has a full history of changes Can be restored to any version A communication tool, like email, but with code rather than human conversation Git - the fast version control system
  • 5. Version control (2) Benefits Git - the fast version control system
  • 6. Version control (2) Benefits Allows a team to share code Git - the fast version control system
  • 7. Version control (2) Benefits Allows a team to share code Maintains separate “production” versions of code that are always deployable Git - the fast version control system
  • 8. Version control (2) Benefits Allows a team to share code Maintains separate “production” versions of code that are always deployable Allows simultaneous development of different features on the same codebase Git - the fast version control system
  • 9. Version control (2) Benefits Allows a team to share code Maintains separate “production” versions of code that are always deployable Allows simultaneous development of different features on the same codebase Keeps track of all old versions of files Git - the fast version control system
  • 10. Version control (2) Benefits Allows a team to share code Maintains separate “production” versions of code that are always deployable Allows simultaneous development of different features on the same codebase Keeps track of all old versions of files Prevents work being overwritten Git - the fast version control system
  • 11. Glossary Some commonly used terms explained before moving on Git - the fast version control system
  • 12. Key terms in version control Branch acopy of a set of files under version control which may be developed at different speeds or in different ways Checkout to copy the latest version of (a file in) the repository to your working copy Commit to copy (a file in) your working copy back into the repository as a new version Merge to combine multiple changes made to different working copies of the same files in the repository Repository a (shared) database with the complete revision history of all files under version control Trunk the unique line of development that is not a branch Update to retrieve and integrate changes in the repository since the update. Working copy your local copies of the files under version control you want to edit Git - the fast version control system
  • 13. Version control systems Git - the fast version control system
  • 14. Very limited and inflexible Concurrent Versions System (CVS) Git - the fast version control system
  • 15. Very limited and inflexible Concurrent Versions System (CVS) Fills most of the holes found in CVS, but added nothing to its development model Subversion (SVN) Git - the fast version control system
  • 16. Very limited and inflexible Concurrent Versions System (CVS) Fills most of the holes found in CVS, but added nothing to its development model Subversion (SVN) More feature rich and functional Git Git - the fast version control system
  • 17. Comparison with SVN Subversion Git Git - the fast version control system
  • 18. Comparison with SVN Subversion Centralized Git Distributed Git - the fast version control system
  • 19. Comparison with SVN Subversion Centralized Branching can be a pain and is used sparingly Git Distributed Branching is very easy and is a core concept Git - the fast version control system
  • 20. Comparison with SVN Subversion Centralized Branching can be a pain and is used sparingly Conflicts frequently occur and renaming is not handled well Git Distributed Branching is very easy and is a core concept Conflicts occur less frequent, renaming is properly handled Git - the fast version control system
  • 21. Comparison with SVN Subversion Centralized Branching can be a pain and is used sparingly Conflicts frequently occur and renaming is not handled well Can be slow due to network latency Git Distributed Branching is very easy and is a core concept Conflicts occur less frequent, renaming is properly handled Very fast since less operations involve network latency Git - the fast version control system
  • 22. Comparison with SVN Subversion Centralized Branching can be a pain and is used sparingly Conflicts frequently occur and renaming is not handled well Can be slow due to network latency Can consume quite some disk space Git Distributed Branching is very easy and is a core concept Conflicts occur less frequent, renaming is properly handled Very fast since less operations involve network latency Consumes 30 times less disk space Git - the fast version control system
  • 23. Distributed version control The new generation of version control Git - the fast version control system
  • 24. A basic, centralized version control system Users commit changes to the central repository and a new version is born to be checked out by other users Git - the fast version control system
  • 25. A distributed version control system Each user has a full local copy of the repository. Users commit changes and when they want to share it, the push it to the shared repository Git - the fast version control system
  • 26. Git usage Basic operations Git - the fast version control system
  • 27. Tracking a project.. Git - the fast version control system
  • 28. Tracking a project.. Mirror the central server Anything the main repository can do, you can do! Git - the fast version control system
  • 29. Tracking a project.. My project is tiny - git is overkill “Why would I carry a Swiss knife when I only want to open cans?” Git - the fast version control system
  • 30. Tracking a project.. Tiny projects should be scalable too! “You wouldn’t use Roman digits just because you perform calculations with small numbers, now would you?” Tiny projects may grow beyond your expectations “One day you’ll desperately need that hex wrench and you’re stuck with your plain can-opener” Git - the fast version control system
  • 31. Tracking a project.. Pretty straightforwarded, huh? Git - the fast version control system
  • 32. Advanced committing… What if you screw up? #re-edit the metadata and update the tree $ git commit --amend or # toss your latest commit away without changing the working tree $ git reset HEAD^ Git - the fast version control system
  • 33. Solving conflicts Instant merging Git - the fast version control system
  • 34. Closer look at pulling.. Git - the fast version control system
  • 35. Auto-merging.. What actually happens… # Fetch latest changes from origin $ git fetch # Merge fetched changes into current branch $ git merge refs/heads/master Git - the fast version control system
  • 36.
  • 37. can detect and handle renamesGit - the fast version control system
  • 38. Resolving conflicts.. Suppose Jeff and Dan both made changes to the same line in file… CONFLICT (content): Merge conflict in file Automatic merge failed; fix conflicts and then commit the result. Uh oh…. now what? Git - the fast version control system
  • 39. Resolving conflicts.. Well, just merge manually… # run your favourite file merge application $ git mergetool –t opendiff Git - the fast version control system
  • 40. Git - the fast version control system source: http://gitguru.com
  • 41. Resolving conflicts.. …and commit! # commit to resolve the conflict $ git commit Git - the fast version control system
  • 42. Branching A core concept Git - the fast version control system
  • 43. Creating a branch.. Git - the fast version control system
  • 44. Creating a branch.. Or create and switch to a branch based on another branch $ git checkout –b new_branch other_branch Git - the fast version control system
  • 45. Some common scenarios… Git - the fast version control system Why would I require branching?
  • 46. Scenario 1 – Interrupted workflow You’re finished with part 1 of a new feature but you can’t continue with part 2 before part 1 is released and tested Git - the fast version control system
  • 47. Scenario 1 – Interrupted workflow You’re finished with part 1 of a new feature but you can’t continue with part 2 before part 1 is released and tested Git - the fast version control system
  • 48. Scenario 2 – Quick fixes While you’re busy implementing some feature suddenly you’re being told to drop everything and fix a newly discovered bug Git - the fast version control system
  • 49. Scenario 2 – Quick fixes While you’re busy implementing some feature suddenly you’re being told to drop everything and fix a newly discovered bug Git - the fast version control system
  • 50. Git usage overview Just to summarize… Git - the fast version control system
  • 51. Git command sequence Source: http://git.or.cz Git - the fast version control system
  • 52. Tooling Stuck at ‘Ye Olde Terminal’? Not necessarily… Git - the fast version control system
  • 53. Git UI front-ends Git - the fast version control system
  • 54.
  • 55.
  • 56. Git ExtensionsWindows Explorer extensions
  • 57.
  • 58.
  • 59. Conclusion Why switch to Git? Git - the fast version control system
  • 60. Reasons to switch to Git Endless, easy, non-file-system-based, local branches Enhanced merging strategy Performance Advanced features enable better workflow Stashing temporary work Collaboration before public commits Git - the fast version control system
  • 61. Closing and Q&A References Git: http://git-scm.com/download Git Docs: http://git-scm.com/documentation GitX: http://gitx.frim.nl/ TortoiseGit: http://code.google.com/p/tortoisegit/ Git Extensions: http://sourceforge.net/projects/gitextensions/ JGit / EGit: http://www.eclipse.org/egit/ Git - the fast version control system