SlideShare une entreprise Scribd logo
1  sur  24
GIT
It’s better. Trust me.
“...is GIT really better than Subversion?”
“...is GIT really better than Subversion?”
History



          Linus Torvalds
History



          Linus Torvalds
History   I hate CVS! I like BitKeeper,
                but it’s not open.




                                          Linus Torvalds
History   I hate CVS! I like BitKeeper,
                but it’s not open.




                                          Linus Torvalds
History           I hate CVS! I like BitKeeper,
                        but it’s not open.



      Wait a minute! I made Linux dammit!
  I should just make my own code repository!
              ...give me 2.5 months




                                                  Linus Torvalds
History           I hate CVS! I like BitKeeper,
                        but it’s not open.



      Wait a minute! I made Linux dammit!
  I should just make my own code repository!
              ...give me 2.5 months
                  Ok! All done!


                                                  Linus Torvalds
History           I hate CVS! I like BitKeeper,
                        but it’s not open.



      Wait a minute! I made Linux dammit!
  I should just make my own code repository!
              ...give me 2.5 months
                  Ok! All done!


                                                  Linus Torvalds
History           I hate CVS! I like BitKeeper,
                        but it’s not open.



      Wait a minute! I made Linux dammit!
  I should just make my own code repository!
              ...give me 2.5 months
                  Ok! All done!


    GIT was made to be:                           Linus Torvalds
 fast, distributed, non-linear,
   use existing protocols,
    and good at merging.
Branching
•   Branches are cheap!

    •   Always work in a branch, which is your own little
        world.

        •   Change didn’t work? Just kill the branch!

•   They are the key to non-linear development.

•   You can’t change branches if your workspace isn’t
    “clean”

•   Always “checkout”!

    •   Switch Branch: git checkout <branch>
Committing
•   In Subversion there is just commit, but in GIT, you commit and push.

    •   GIT is distributed, so you commit locally and then only push to
        another server when needed.

•   “status” allows you to see current changes or files not in the repo.

    •   git status

•   Files must be added to the repo, and if changed, the commit.

    •   git add <filename or path> or add everything to the
        commit with git commit -a

•   Set a commit message with -m: git commit -m “Crazy awesome
Pushing
•   GIT is distributed! ...but we don’t use it that way. We use a single
    “origin” that we all push and pull from.

•   Remember that you commit locally and use “git push” to add your new
    changes to the origin.
    •   git push origin/<branch>

    •   Remember:

        •   When pushing a shared branch, you must be up-to-date first.

        •   You can never push to master!
Merging
•   You use “git merge” to bring a different hash’s
    changes in to your current branch.
• git merge <hash>
• You can also use the branch name as a
    shortcut to it’s latest hash.

•   After merging, git will output data about the
    changes merged in.
Diff
•   Diff is a way to
    compare two code
    changes (or hashes)
• git   diff
    <hash1> <hash2>

•   If you only give the
    diff command one
    hash, it will assume
    you are diff’ing the
    currently checked
Demo!
Config
•   Your global config lives at: ~/.gitconfig (*nix)

•   Aliases give you the power of chaining git commands together in one
    command.




•   You can also your name & email for commits globally...




•   ...as well as set color schemes and your diff tool of choice.
Other Tricks
 • git reset [--hard] <hash>
  • Resets your current workspace to a given hash.
 • git log -<max>
  • Allows you to see the current branch’s history.
 • git stash
  • Allows you to set aside your current changes
     temporarily.

   •   git stash pop brings your changes back to your
       current workspace.
Demo!
Tools

“What’s the fastest and best way to use GIT?”
Tools

“What’s the fastest and best way to use GIT?”
Tools
•   Windows

    •   Clients

        •   MsysGIT http://code.google.com/p/msysgit/

        •   TortoiseGit http://code.google.com/p/tortoisegit/

    •   Diff Tool

        •   DiffMerge http://www.sourcegear.com/diffmerge/index.html

•   Mac Tools

    •   Clients

        •   GIT-Y http://gityapp.com/ $0

        •   Gitbox http://gitboxapp.com/ $39

        •   Tower http://www.git-tower.com/ $59
    •   Diff Tool

        •   File Merge (included with XCode)
Questions?

Contenu connexe

Dernier

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 

Dernier (20)

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 

En vedette

Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 

En vedette (20)

Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 

Git: It's Better. Trust Me.

  • 2. “...is GIT really better than Subversion?”
  • 3. “...is GIT really better than Subversion?”
  • 4. History Linus Torvalds
  • 5. History Linus Torvalds
  • 6. History I hate CVS! I like BitKeeper, but it’s not open. Linus Torvalds
  • 7. History I hate CVS! I like BitKeeper, but it’s not open. Linus Torvalds
  • 8. History I hate CVS! I like BitKeeper, but it’s not open. Wait a minute! I made Linux dammit! I should just make my own code repository! ...give me 2.5 months Linus Torvalds
  • 9. History I hate CVS! I like BitKeeper, but it’s not open. Wait a minute! I made Linux dammit! I should just make my own code repository! ...give me 2.5 months Ok! All done! Linus Torvalds
  • 10. History I hate CVS! I like BitKeeper, but it’s not open. Wait a minute! I made Linux dammit! I should just make my own code repository! ...give me 2.5 months Ok! All done! Linus Torvalds
  • 11. History I hate CVS! I like BitKeeper, but it’s not open. Wait a minute! I made Linux dammit! I should just make my own code repository! ...give me 2.5 months Ok! All done! GIT was made to be: Linus Torvalds fast, distributed, non-linear, use existing protocols, and good at merging.
  • 12. Branching • Branches are cheap! • Always work in a branch, which is your own little world. • Change didn’t work? Just kill the branch! • They are the key to non-linear development. • You can’t change branches if your workspace isn’t “clean” • Always “checkout”! • Switch Branch: git checkout <branch>
  • 13. Committing • In Subversion there is just commit, but in GIT, you commit and push. • GIT is distributed, so you commit locally and then only push to another server when needed. • “status” allows you to see current changes or files not in the repo. • git status • Files must be added to the repo, and if changed, the commit. • git add <filename or path> or add everything to the commit with git commit -a • Set a commit message with -m: git commit -m “Crazy awesome
  • 14. Pushing • GIT is distributed! ...but we don’t use it that way. We use a single “origin” that we all push and pull from. • Remember that you commit locally and use “git push” to add your new changes to the origin. • git push origin/<branch> • Remember: • When pushing a shared branch, you must be up-to-date first. • You can never push to master!
  • 15. Merging • You use “git merge” to bring a different hash’s changes in to your current branch. • git merge <hash> • You can also use the branch name as a shortcut to it’s latest hash. • After merging, git will output data about the changes merged in.
  • 16. Diff • Diff is a way to compare two code changes (or hashes) • git diff <hash1> <hash2> • If you only give the diff command one hash, it will assume you are diff’ing the currently checked
  • 17. Demo!
  • 18. Config • Your global config lives at: ~/.gitconfig (*nix) • Aliases give you the power of chaining git commands together in one command. • You can also your name & email for commits globally... • ...as well as set color schemes and your diff tool of choice.
  • 19. Other Tricks • git reset [--hard] <hash> • Resets your current workspace to a given hash. • git log -<max> • Allows you to see the current branch’s history. • git stash • Allows you to set aside your current changes temporarily. • git stash pop brings your changes back to your current workspace.
  • 20. Demo!
  • 21. Tools “What’s the fastest and best way to use GIT?”
  • 22. Tools “What’s the fastest and best way to use GIT?”
  • 23. Tools • Windows • Clients • MsysGIT http://code.google.com/p/msysgit/ • TortoiseGit http://code.google.com/p/tortoisegit/ • Diff Tool • DiffMerge http://www.sourcegear.com/diffmerge/index.html • Mac Tools • Clients • GIT-Y http://gityapp.com/ $0 • Gitbox http://gitboxapp.com/ $39 • Tower http://www.git-tower.com/ $59 • Diff Tool • File Merge (included with XCode)

Notes de l'éditeur

  1. \n
  2. \n
  3. The development of Git began on April 3, 2005. The project was announced on April 6, and became self-hosting as of April 7. The first merge of multiple branches was done on April 18. Torvalds achieved his performance goals; on April 29, the nascent Git was benchmarked recording patches to the Linux kernel tree at the rate of 6.7 per second. On June 16, the kernel 2.6.12 release was managed by Git.\n\nFast: Binaries are all fast C apps.\nDistributed: There isn&amp;#x2019;t just one origin, but any GIT client can also serve code.\nNon-Linear: Allow for rapid branching and merging.\nProtocols: Uses FTP, HTTP, or SSH\nMerging: A change is merged more than it&amp;#x2019;s written! Merging branches must be quick and easy.\n
  4. The development of Git began on April 3, 2005. The project was announced on April 6, and became self-hosting as of April 7. The first merge of multiple branches was done on April 18. Torvalds achieved his performance goals; on April 29, the nascent Git was benchmarked recording patches to the Linux kernel tree at the rate of 6.7 per second. On June 16, the kernel 2.6.12 release was managed by Git.\n\nFast: Binaries are all fast C apps.\nDistributed: There isn&amp;#x2019;t just one origin, but any GIT client can also serve code.\nNon-Linear: Allow for rapid branching and merging.\nProtocols: Uses FTP, HTTP, or SSH\nMerging: A change is merged more than it&amp;#x2019;s written! Merging branches must be quick and easy.\n
  5. The development of Git began on April 3, 2005. The project was announced on April 6, and became self-hosting as of April 7. The first merge of multiple branches was done on April 18. Torvalds achieved his performance goals; on April 29, the nascent Git was benchmarked recording patches to the Linux kernel tree at the rate of 6.7 per second. On June 16, the kernel 2.6.12 release was managed by Git.\n\nFast: Binaries are all fast C apps.\nDistributed: There isn&amp;#x2019;t just one origin, but any GIT client can also serve code.\nNon-Linear: Allow for rapid branching and merging.\nProtocols: Uses FTP, HTTP, or SSH\nMerging: A change is merged more than it&amp;#x2019;s written! Merging branches must be quick and easy.\n
  6. The development of Git began on April 3, 2005. The project was announced on April 6, and became self-hosting as of April 7. The first merge of multiple branches was done on April 18. Torvalds achieved his performance goals; on April 29, the nascent Git was benchmarked recording patches to the Linux kernel tree at the rate of 6.7 per second. On June 16, the kernel 2.6.12 release was managed by Git.\n\nFast: Binaries are all fast C apps.\nDistributed: There isn&amp;#x2019;t just one origin, but any GIT client can also serve code.\nNon-Linear: Allow for rapid branching and merging.\nProtocols: Uses FTP, HTTP, or SSH\nMerging: A change is merged more than it&amp;#x2019;s written! Merging branches must be quick and easy.\n
  7. The development of Git began on April 3, 2005. The project was announced on April 6, and became self-hosting as of April 7. The first merge of multiple branches was done on April 18. Torvalds achieved his performance goals; on April 29, the nascent Git was benchmarked recording patches to the Linux kernel tree at the rate of 6.7 per second. On June 16, the kernel 2.6.12 release was managed by Git.\n\nFast: Binaries are all fast C apps.\nDistributed: There isn&amp;#x2019;t just one origin, but any GIT client can also serve code.\nNon-Linear: Allow for rapid branching and merging.\nProtocols: Uses FTP, HTTP, or SSH\nMerging: A change is merged more than it&amp;#x2019;s written! Merging branches must be quick and easy.\n
  8. The development of Git began on April 3, 2005. The project was announced on April 6, and became self-hosting as of April 7. The first merge of multiple branches was done on April 18. Torvalds achieved his performance goals; on April 29, the nascent Git was benchmarked recording patches to the Linux kernel tree at the rate of 6.7 per second. On June 16, the kernel 2.6.12 release was managed by Git.\n\nFast: Binaries are all fast C apps.\nDistributed: There isn&amp;#x2019;t just one origin, but any GIT client can also serve code.\nNon-Linear: Allow for rapid branching and merging.\nProtocols: Uses FTP, HTTP, or SSH\nMerging: A change is merged more than it&amp;#x2019;s written! Merging branches must be quick and easy.\n
  9. The development of Git began on April 3, 2005. The project was announced on April 6, and became self-hosting as of April 7. The first merge of multiple branches was done on April 18. Torvalds achieved his performance goals; on April 29, the nascent Git was benchmarked recording patches to the Linux kernel tree at the rate of 6.7 per second. On June 16, the kernel 2.6.12 release was managed by Git.\n\nFast: Binaries are all fast C apps.\nDistributed: There isn&amp;#x2019;t just one origin, but any GIT client can also serve code.\nNon-Linear: Allow for rapid branching and merging.\nProtocols: Uses FTP, HTTP, or SSH\nMerging: A change is merged more than it&amp;#x2019;s written! Merging branches must be quick and easy.\n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. 1. cd ~/wa-sandbox\n2. Create branch\n3. Add files\n4. Commit files\n5. Back to master\n6. Make new branch\n7. Add/modify files\n8. Diff\n9. Commit\n10. Back to master\n11. Peer Review! Check diff from master and branch 1.\n12. Switch to branch and make a change.\n13. Commit.\n14. Back to master.\n15. Make CAB branch\n16. Merge in both branches\n17. Push\n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n