SlideShare a Scribd company logo
1 of 58
Do You Git It?
  A saucerful of
 Version Control
             Knut Haugen 2011-10-11
Linus + Linux
    = Git
Distribuert vs.
 sentralisert
Sentralisert

          checkout
Working
 copy
                     Repo
          commit
Sentralisert
Working    che
                  cko
                           ut
 copy
          com
             mit
                                Repo
                    o ut
               ck
          c he
Working             mit
 copy         c   om
Distribuert
    host                     host
                      pull
working
               repo          repo
 copy commit
                      push
Distribuert
host          host
       pull
repo   push   repo
Distribuert
host          host
       pull
repo   push   repo



       host

       repo
Distribuert
host          host
       pull
repo   push   repo



       host

       repo
Distribuert
host          host
       pull
repo   push   repo



       host

       repo
Egenskaper
Filbasert
Raskt
Checksum
Attention
 to detail
Lettere
branches
Endringer,
ikke filer
“vanlig”
versjonskontroll
Git
Modell
Modell
Modell
Modell
Modell
Modell
Modell
Modell
git add <file>
git commit
Commit
git reset -- <files>
Reset
git checkout -- <files>
Checkout
git diff <files>
Diff
Merge
Merge
Merge
Merge
Merge
Merge
Merge
Merge
Demo
stash
log
show
reset
amend
branch +
 merge
push + pull
Når skal vi
 bytte ut
  SVN?

More Related Content

What's hot (20)

The Fundamentals of Git
The Fundamentals of GitThe Fundamentals of Git
The Fundamentals of Git
 
Git for the absolute beginners
Git for the absolute beginnersGit for the absolute beginners
Git for the absolute beginners
 
Git vs svn
Git vs svnGit vs svn
Git vs svn
 
Git tutorial
Git tutorialGit tutorial
Git tutorial
 
Git-ing out of your git messes
Git-ing out of  your git messesGit-ing out of  your git messes
Git-ing out of your git messes
 
From svn to git
From svn to gitFrom svn to git
From svn to git
 
Git commands
Git commandsGit commands
Git commands
 
Git basics
Git basicsGit basics
Git basics
 
Git Tech Talk
Git  Tech TalkGit  Tech Talk
Git Tech Talk
 
Git Tutorial I
Git Tutorial IGit Tutorial I
Git Tutorial I
 
Git for beginners
Git for beginnersGit for beginners
Git for beginners
 
Introduction to Git and GitHub
Introduction to Git and GitHubIntroduction to Git and GitHub
Introduction to Git and GitHub
 
Git basic
Git basicGit basic
Git basic
 
Version Control with Git for Beginners
Version Control with Git for BeginnersVersion Control with Git for Beginners
Version Control with Git for Beginners
 
Version Control Systems with git (and github) as an example
Version Control Systems with git (and github) as an exampleVersion Control Systems with git (and github) as an example
Version Control Systems with git (and github) as an example
 
Git SCM
Git SCMGit SCM
Git SCM
 
Git for beginner
Git for beginnerGit for beginner
Git for beginner
 
Introduction To Git
Introduction To GitIntroduction To Git
Introduction To Git
 
Git: An introduction of plumbing and porcelain commands
Git: An introduction of plumbing and porcelain commandsGit: An introduction of plumbing and porcelain commands
Git: An introduction of plumbing and porcelain commands
 
Git introduction workshop for scientists
Git introduction workshop for scientists Git introduction workshop for scientists
Git introduction workshop for scientists
 

Similar to Basic Git (20)

Getting started with GIT
Getting started with GITGetting started with GIT
Getting started with GIT
 
Session git
Session gitSession git
Session git
 
Git basic stanley hsiao 2010_12_15
Git basic stanley hsiao 2010_12_15Git basic stanley hsiao 2010_12_15
Git basic stanley hsiao 2010_12_15
 
Git 101
Git 101Git 101
Git 101
 
Git and git hub
Git and git hubGit and git hub
Git and git hub
 
Git 101 for CloudStack
Git 101 for CloudStackGit 101 for CloudStack
Git 101 for CloudStack
 
Git
GitGit
Git
 
Git&GitHub.pptx
Git&GitHub.pptxGit&GitHub.pptx
Git&GitHub.pptx
 
Git like a pro EDD18 - Full edition
Git like a pro EDD18 - Full editionGit like a pro EDD18 - Full edition
Git like a pro EDD18 - Full edition
 
Git Going with DVCS v1.6.0
Git Going with DVCS v1.6.0Git Going with DVCS v1.6.0
Git Going with DVCS v1.6.0
 
Git
GitGit
Git
 
Git slide
Git slideGit slide
Git slide
 
Wokshop de Git
Wokshop de Git Wokshop de Git
Wokshop de Git
 
Git
GitGit
Git
 
Git
GitGit
Git
 
BSADD-Git-TRAINING
BSADD-Git-TRAININGBSADD-Git-TRAINING
BSADD-Git-TRAINING
 
Bsadd training-git
Bsadd training-gitBsadd training-git
Bsadd training-git
 
GIT.pptx
GIT.pptxGIT.pptx
GIT.pptx
 
Git training (basic)
Git training (basic)Git training (basic)
Git training (basic)
 
GIT Basics
GIT BasicsGIT Basics
GIT Basics
 

Recently uploaded

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
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
 
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
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
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
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - 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
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 

Recently uploaded (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
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...
 
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...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
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
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - 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
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 

Basic Git

Editor's Notes

  1. \n
  2. Linus skrev det for linux i 2005. Laget spesielt for store kodebaser med \ndistribuert team. Optimalisert for det. Veldig mye mer popul&amp;#xE6;rt med github.\n\n
  3. Alle er likeverdige, ingen er egentlig master. Selv om det er vanlig &amp;#xE5; bruke en master. Finnes flere distribuerte versjonskontrollsystemer.\n\n
  4. \n
  5. Det som sjekkes inn, er tilgjengelig for andre med en gang.\n
  6. Det som sjekkes inn, er hos deg til du pusher. \nM&amp;#xE5; ikke v&amp;#xE6;re host her, kan bare v&amp;#xE6;re et annet sted. Dette er et litt forenklet bilde. Detaljer kommer.\n
  7. Du har full distribuering og kan velge \n
  8. Du har full distribuering og kan velge \n
  9. Du har full distribuering og kan velge \n
  10. \n
  11. .git katalog med alt i. I directoryet ditt. Men ikke som rcs i gamle dager\n
  12. lokale filer, ikke nettverk.\n
  13. integritetssjekk, men ogs&amp;#xE5; revision.\n
  14. git log pager default, sier ingenting n&amp;#xE5;r den ikke har noe &amp;#xE5; melde, tilpassninger. Kan v&amp;#xE6;re litt kryptisk. \n
  15. \n
  16. En commit er en snapshot av et filsystem, ikke delta for filer som s&amp;#xE5;dan. \n
  17. \n
  18. snapshots av et filsystem\n\n
  19. \n
  20. Default branch er master\n
  21. lage en ny branch lager en peker\n
  22. HEAD er en spesiell peker til den branchen du er p&amp;#xE5; n&amp;#xE5;\n
  23. checkout av branch endrer HEAD\n
  24. ny commit til branch\n
  25. Checkout master igjen\n
  26. Working dir, staging, history\n
  27. Legg til i stage\n
  28. commit stage til history\n
  29. HEAD var p&amp;#xE5; ed489, ny commit legger til en ny, me ed489 som \nparent, og flytter head til den.\n
  30. unstage - copy from last commit to stage\n
  31. Kopierer fra commit til stage\n
  32. \n
  33. head -1 til stage og working\n
  34. \n
  35. diff mellom to commits, diff fra head til stage eller diff fra head til working dir eller fra en branch\n
  36. Vi jobber i master med vanlig saker.\n
  37. Skal jobbe med en ny issue, lager en branch for issue 53\n
  38. Committer p&amp;#xE5; branchen\n
  39. F&amp;#xE5;r hastebeskjed fra J&amp;#xF8;rgen om &amp;#xE5; hotfixe master. Lager en ny branch og committer der\n
  40. fast forward merge siden hotfix er downstream fra master. Flytter bare peker\n
  41. Fortsetter p&amp;#xE5; iss53 og committer mer.\n
  42. Skal merge og m&amp;#xE5; gj&amp;#xF8;re en three-way merge\n
  43. Dette lager en ny commit i master etter merge. \n
  44. \n
  45. git stash (anonym)\ngit stash save &amp;#x201C;navn&amp;#x201D;\ngit stash show id\ngit stash list, git stash show stash@{0}, git stash show -p stash@{0}\n\n
  46. git log -p (diff) git log --stat (changes) git log --pretty=online\ngit log --pretty=oneline --graph\ngit log --before=&quot;1 week ago&quot; --after=&quot;2011-09-20&quot; --pretty=oneline git log --pretty=oneline 710f0f..8a5cbc\n\n\n
  47. git log + git show p&amp;#xE5; en. Kj&amp;#xF8;r kortere og kortere hash til det brekker\n
  48. git add + git reset\ngit add foo + endre fil+ git reset --hard\n
  49. git commit -m &amp;#x201C;&amp;#x201D; foo, git commit --amend -m &amp;#x201C;new messages&amp;#x201D; foo\ngir ny commit, men bare en fortsatt\n
  50. git branch $branch\ngit branch (list) + -v\ngit checkout $branch\ngit commit i branch\nbytt til master\ngit merge testbranch\ngit branch -d $branch\n
  51. git fetch (fetch, ikke merge)\ngit pull (fetch + merge)\ngit push origin master (se p&amp;#xE5; github)\n
  52. \n