SlideShare uma empresa Scribd logo
1 de 64
Baixar para ler offline
Git It!
 Michele Mattioni
mattioni@ebi.ac.uk
    @mattions
<1>
My ideal version control system
●   Fast
●   Flexible
●   Offline
●   Smart
CVS/SVN
●   CVS:
    –   I never used CVS. I'm too young.
●   SVN:
    –   I can't commit locally
    –   I can't branch as I wish
    –   The Merging just doesn't work.
    –   All the operation are on-line. (No connection no
        cookies)
Bazaar
●   Good things:
    –   No network needed
    –   Really cool way to export your code in a tarball
●   Problems:
    –   SVN interface didn't work properly
    –   Branching and merging is ok but not as fast as git.
What is Git?




Git is an opensource distributed verson control
        system which makes you happy.
Hey, but I work alone!
●   Do you develop in linear fashon?



●   Do you usually make a massive commit and
    then you can't track what you had really
    changed?
Or... I have just a bunch of files
●   Don't you change them quite often?
●   Don't you need to keep track of what is going
    on?
●   ...
</1>
<2>
Different Way of thinking:
      Delta Storage
Local Rules:
        With No Network you can:
●   Performing a diff
●   Viewing file history
●   Committing changes
●   Merging branches
●   Obtaining any other revision of a file
●   Switching branches
Non Linear Development:
     Try your ideas
Freedom!!!!
You can move around a lot of
  branches and try different things

$ git   checkout -b feature_x
#hack   #hack
$ git   commit -am ”Adding new feature_x”
$ git   checkout master
$ git   merge feature_x


                It's fast
           You retain control
</2>
<3>
Basic use:


   git init – Init a new repository

git add file1-- Add file1 to the repo

git commit -m ”My first initial
        commit” -- Commit
Stage Idea
add a file you don't commit it but you
           put it in the index
If you just add a file this is staged but
             not committed
Commit: You commit everything that
         you have added
When you commit the file is
  recorded in the repo.
Scenario



     File1 -- Correct a typo

File2 -- introduced a new method

File3 -- Introduced new method
Control gives you flexibility


$ git add file1
$ git commit -m ”corrected a typo.”


$ git add file2 file3
$ git commit -m ”Introduced the
 newfeature to land on the moon.”
Mantra: Small commit are good



Do a lot of commit and divide your change
            logically in small part.

 It will help you a lot when you will break
          everything (and you will...)
-a switch




git commit -am ”I commit all 3 files
             in one go.”
</3>
<4>
Working online


$ git push origin master
$ git pull origin master


Can be any branch

$ git push origin feature_x
github.com/edu
Github is just good
Easy docs for your project hosted
         automatically
Nice way to collaborate
</4>
Bonus info

#git branch
parse_git_branch() {
git branch 2> /dev/null | sed -e
 '/^[^*]/d' -e 's/* (.*)/(1)/'
}
#grey
PS1='[33[0;32m]u[33[1;32m]@
 [33[0;32m]h[33[00m]:
 [33[01;34m]W[33[1;30m]$
 (parse_git_branch)[33[00m]$ '
Results
Useful resources:


   Git    http://git-scm.com/
   Github http://github.com

   Nice guide http://rogerdudler.github.com/git-guide/

                                my profile https://github.com/mattions


Credits: Some of the slides were taken from Scott Chacon
                                https://github.com/schacon

Mais conteúdo relacionado

Mais procurados

Run python from windows taskscheduler
Run python from windows taskschedulerRun python from windows taskscheduler
Run python from windows taskschedulerNorifumi Irie
 
Lcna 2012-example
Lcna 2012-exampleLcna 2012-example
Lcna 2012-exampleGluster.org
 
Gojko Adzic Cucumber
Gojko Adzic CucumberGojko Adzic Cucumber
Gojko Adzic CucumberSkills Matter
 
Automating JavaScript testing with Jasmine and Perl
Automating JavaScript testing with Jasmine and PerlAutomating JavaScript testing with Jasmine and Perl
Automating JavaScript testing with Jasmine and Perlnohuhu
 
Background processes and tasks in an async world
Background processes and tasks in an async worldBackground processes and tasks in an async world
Background processes and tasks in an async worldparticlebanana
 
What is version control software and why do you need it?
What is version control software and why do you need it?What is version control software and why do you need it?
What is version control software and why do you need it?Leonid Mamchenkov
 
Improve the deployment process step by step
Improve the deployment process step by stepImprove the deployment process step by step
Improve the deployment process step by stepDaniel Fahlke
 
Git isthenewsexy
Git isthenewsexyGit isthenewsexy
Git isthenewsexyAilsa126
 
What has source control ever done for us?
What has source control ever done for us?What has source control ever done for us?
What has source control ever done for us?Andrew Grimm
 
Learning GitHub Part 1
Learning GitHub Part 1Learning GitHub Part 1
Learning GitHub Part 1Lynn Langit
 
Learning GitHub Part 4
Learning GitHub Part 4Learning GitHub Part 4
Learning GitHub Part 4Lynn Langit
 
Vinted life embetterment
Vinted life embettermentVinted life embetterment
Vinted life embettermentAgile Lietuva
 
Why on earth is git super awesome?
Why on earth is git super awesome?Why on earth is git super awesome?
Why on earth is git super awesome?Chris Brown
 
Continuous Integration for Pharo Smalltalk Part 2 (Smalltalk and Travis CI)
Continuous Integration for Pharo Smalltalk Part 2 (Smalltalk and Travis CI)Continuous Integration for Pharo Smalltalk Part 2 (Smalltalk and Travis CI)
Continuous Integration for Pharo Smalltalk Part 2 (Smalltalk and Travis CI)Sho Yoshida
 

Mais procurados (20)

Run python from windows taskscheduler
Run python from windows taskschedulerRun python from windows taskscheduler
Run python from windows taskscheduler
 
Lcna 2012-example
Lcna 2012-exampleLcna 2012-example
Lcna 2012-example
 
Gojko Adzic Cucumber
Gojko Adzic CucumberGojko Adzic Cucumber
Gojko Adzic Cucumber
 
Automating JavaScript testing with Jasmine and Perl
Automating JavaScript testing with Jasmine and PerlAutomating JavaScript testing with Jasmine and Perl
Automating JavaScript testing with Jasmine and Perl
 
Background processes and tasks in an async world
Background processes and tasks in an async worldBackground processes and tasks in an async world
Background processes and tasks in an async world
 
What is version control software and why do you need it?
What is version control software and why do you need it?What is version control software and why do you need it?
What is version control software and why do you need it?
 
Improve the deployment process step by step
Improve the deployment process step by stepImprove the deployment process step by step
Improve the deployment process step by step
 
Git isthenewsexy
Git isthenewsexyGit isthenewsexy
Git isthenewsexy
 
Git Introduction
Git IntroductionGit Introduction
Git Introduction
 
Leveragong splunk for finding needle in the Haystack
Leveragong splunk for finding needle in the HaystackLeveragong splunk for finding needle in the Haystack
Leveragong splunk for finding needle in the Haystack
 
What has source control ever done for us?
What has source control ever done for us?What has source control ever done for us?
What has source control ever done for us?
 
Git Tutorial
Git TutorialGit Tutorial
Git Tutorial
 
Learning GitHub Part 1
Learning GitHub Part 1Learning GitHub Part 1
Learning GitHub Part 1
 
Learning GitHub Part 4
Learning GitHub Part 4Learning GitHub Part 4
Learning GitHub Part 4
 
Vinted life embetterment
Vinted life embettermentVinted life embetterment
Vinted life embetterment
 
Why on earth is git super awesome?
Why on earth is git super awesome?Why on earth is git super awesome?
Why on earth is git super awesome?
 
Ratpack JVM_MX Meetup February 2016
Ratpack JVM_MX Meetup February 2016Ratpack JVM_MX Meetup February 2016
Ratpack JVM_MX Meetup February 2016
 
Git Heaven with Wakanda
Git Heaven with WakandaGit Heaven with Wakanda
Git Heaven with Wakanda
 
Process file one after another
Process file one after anotherProcess file one after another
Process file one after another
 
Continuous Integration for Pharo Smalltalk Part 2 (Smalltalk and Travis CI)
Continuous Integration for Pharo Smalltalk Part 2 (Smalltalk and Travis CI)Continuous Integration for Pharo Smalltalk Part 2 (Smalltalk and Travis CI)
Continuous Integration for Pharo Smalltalk Part 2 (Smalltalk and Travis CI)
 

Destaque

Neuronvisio sumatra workflow
Neuronvisio sumatra workflowNeuronvisio sumatra workflow
Neuronvisio sumatra workflowMichele Mattioni
 
Hype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerHype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerLuminary Labs
 
Study: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsStudy: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsLinkedIn
 

Destaque (8)

Neuronvisio sumatra workflow
Neuronvisio sumatra workflowNeuronvisio sumatra workflow
Neuronvisio sumatra workflow
 
Sumatra and git
Sumatra and gitSumatra and git
Sumatra and git
 
Neuronvisio Intro
Neuronvisio IntroNeuronvisio Intro
Neuronvisio Intro
 
Django packages list
Django packages listDjango packages list
Django packages list
 
Neuronvisio codejam5
Neuronvisio codejam5Neuronvisio codejam5
Neuronvisio codejam5
 
Scipy, numpy and friends
Scipy, numpy and friendsScipy, numpy and friends
Scipy, numpy and friends
 
Hype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerHype vs. Reality: The AI Explainer
Hype vs. Reality: The AI Explainer
 
Study: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsStudy: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving Cars
 

Semelhante a Git It

Luis atencio on_git
Luis atencio on_gitLuis atencio on_git
Luis atencio on_gitLuis Atencio
 
Source Code Management with Git
Source Code Management with GitSource Code Management with Git
Source Code Management with GitThings Lab
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub태환 김
 
Working with multiple git repositories
Working with multiple git repositoriesWorking with multiple git repositories
Working with multiple git repositoriesJulien Pivotto
 
Introduction to Git for Artists
Introduction to Git for ArtistsIntroduction to Git for Artists
Introduction to Git for ArtistsDavid Newbury
 
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
 
The Fundamentals of Git
The Fundamentals of GitThe Fundamentals of Git
The Fundamentals of GitDivineOmega
 
Git_tutorial.pdf
Git_tutorial.pdfGit_tutorial.pdf
Git_tutorial.pdfAliaaTarek5
 
Git Merge, Resets and Branches
Git Merge, Resets and BranchesGit Merge, Resets and Branches
Git Merge, Resets and BranchesVictor Pudelski
 
Git Obstacle Course: Stop BASHing your head and break down the basics
Git Obstacle Course: Stop BASHing your head and break down the basicsGit Obstacle Course: Stop BASHing your head and break down the basics
Git Obstacle Course: Stop BASHing your head and break down the basicsChris Bohatka
 
Git with the flow
Git with the flowGit with the flow
Git with the flowDana White
 
Git 101: Force-sensitive to Jedi padawan
Git 101: Force-sensitive to Jedi padawanGit 101: Force-sensitive to Jedi padawan
Git 101: Force-sensitive to Jedi padawanJames Ford
 
The Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHubThe Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHubBigBlueHat
 

Semelhante a Git It (20)

Luis atencio on_git
Luis atencio on_gitLuis atencio on_git
Luis atencio on_git
 
Source Code Management with Git
Source Code Management with GitSource Code Management with Git
Source Code Management with Git
 
3 Git
3 Git3 Git
3 Git
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
 
Working with multiple git repositories
Working with multiple git repositoriesWorking with multiple git repositories
Working with multiple git repositories
 
Git github
Git githubGit github
Git github
 
Introduction to Git for Artists
Introduction to Git for ArtistsIntroduction to Git for Artists
Introduction to Git for Artists
 
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
 
The Fundamentals of Git
The Fundamentals of GitThe Fundamentals of Git
The Fundamentals of Git
 
Git_tutorial.pdf
Git_tutorial.pdfGit_tutorial.pdf
Git_tutorial.pdf
 
Git Merge, Resets and Branches
Git Merge, Resets and BranchesGit Merge, Resets and Branches
Git Merge, Resets and Branches
 
Git Obstacle Course: Stop BASHing your head and break down the basics
Git Obstacle Course: Stop BASHing your head and break down the basicsGit Obstacle Course: Stop BASHing your head and break down the basics
Git Obstacle Course: Stop BASHing your head and break down the basics
 
Git with the flow
Git with the flowGit with the flow
Git with the flow
 
Techoalien git
Techoalien gitTechoalien git
Techoalien git
 
Techoalien git
Techoalien gitTechoalien git
Techoalien git
 
Techoalien git
Techoalien gitTechoalien git
Techoalien git
 
How to use git without rage
How to use git without rageHow to use git without rage
How to use git without rage
 
Git 101: Force-sensitive to Jedi padawan
Git 101: Force-sensitive to Jedi padawanGit 101: Force-sensitive to Jedi padawan
Git 101: Force-sensitive to Jedi padawan
 
The Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHubThe Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHub
 
Git
GitGit
Git
 

Último

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 

Último (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 

Git It

  • 1. Git It! Michele Mattioni mattioni@ebi.ac.uk @mattions
  • 2. <1>
  • 3. My ideal version control system ● Fast ● Flexible ● Offline ● Smart
  • 4. CVS/SVN ● CVS: – I never used CVS. I'm too young. ● SVN: – I can't commit locally – I can't branch as I wish – The Merging just doesn't work. – All the operation are on-line. (No connection no cookies)
  • 5. Bazaar ● Good things: – No network needed – Really cool way to export your code in a tarball ● Problems: – SVN interface didn't work properly – Branching and merging is ok but not as fast as git.
  • 6. What is Git? Git is an opensource distributed verson control system which makes you happy.
  • 7. Hey, but I work alone! ● Do you develop in linear fashon? ● Do you usually make a massive commit and then you can't track what you had really changed?
  • 8. Or... I have just a bunch of files ● Don't you change them quite often? ● Don't you need to keep track of what is going on? ● ...
  • 10. <2>
  • 11. Different Way of thinking: Delta Storage
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25. Local Rules: With No Network you can: ● Performing a diff ● Viewing file history ● Committing changes ● Merging branches ● Obtaining any other revision of a file ● Switching branches
  • 26.
  • 27.
  • 28.
  • 29.
  • 30. Non Linear Development: Try your ideas
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39. You can move around a lot of branches and try different things $ git checkout -b feature_x #hack #hack $ git commit -am ”Adding new feature_x” $ git checkout master $ git merge feature_x It's fast You retain control
  • 40. </2>
  • 41. <3>
  • 42. Basic use: git init – Init a new repository git add file1-- Add file1 to the repo git commit -m ”My first initial commit” -- Commit
  • 44. add a file you don't commit it but you put it in the index
  • 45. If you just add a file this is staged but not committed
  • 46. Commit: You commit everything that you have added
  • 47. When you commit the file is recorded in the repo.
  • 48. Scenario File1 -- Correct a typo File2 -- introduced a new method File3 -- Introduced new method
  • 49. Control gives you flexibility $ git add file1 $ git commit -m ”corrected a typo.” $ git add file2 file3 $ git commit -m ”Introduced the newfeature to land on the moon.”
  • 50. Mantra: Small commit are good Do a lot of commit and divide your change logically in small part. It will help you a lot when you will break everything (and you will...)
  • 51.
  • 52.
  • 53. -a switch git commit -am ”I commit all 3 files in one go.”
  • 54. </3>
  • 55. <4>
  • 56. Working online $ git push origin master $ git pull origin master Can be any branch $ git push origin feature_x
  • 59. Easy docs for your project hosted automatically
  • 60. Nice way to collaborate
  • 61. </4>
  • 62. Bonus info #git branch parse_git_branch() { git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* (.*)/(1)/' } #grey PS1='[33[0;32m]u[33[1;32m]@ [33[0;32m]h[33[00m]: [33[01;34m]W[33[1;30m]$ (parse_git_branch)[33[00m]$ '
  • 64. Useful resources: Git http://git-scm.com/ Github http://github.com Nice guide http://rogerdudler.github.com/git-guide/ my profile https://github.com/mattions Credits: Some of the slides were taken from Scott Chacon https://github.com/schacon