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

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

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
Chen-Han Hsiao
 
BSADD-Git-TRAINING
BSADD-Git-TRAININGBSADD-Git-TRAINING
BSADD-Git-TRAINING
bsadd
 

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

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
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
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
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
Safe Software
 

Recently uploaded (20)

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
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
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
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
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
 
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...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
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, ...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
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...
 
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
 
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...
 
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
 

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