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

#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
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
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 

Recently uploaded (20)

#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
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
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 

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