SlideShare ist ein Scribd-Unternehmen logo
1 von 132
Git &
Github
Housekeeping
•Slides & blog post will be
 available at:
 blog.mattgauger.com

•Follow me: twitter.com/mathiasx
•More resources at the end &
 linked in my blog post
Giving not just one talk,
not two, but three talks
     in December!
MKE PHP User’s Group:
     PHP vs. Rails
    Dec 14th 6PM
MKE Ruby User’s Group:
What’s new and great in
        Rails 3
    Dec 20th 7PM
About Me
I am not an expert.
This talk is aimed at
     beginners.
So please do play
      along.
Introducing:
A fictional user that
has never used git.
Get Stuff Done.
Github is the hook.
jQuery        prototype
scriptaculous mootools
yui3
Ruby on Rails web.py &
Symfony       many others
Django
But why is Github so
     popular?
Let’s take a look.
Github is popular because
it optimizes for the things
  developers need to do
It doesn’t get in the way.
And because it’s fun.
Back to our user.
Found Heard on
  Pete’s blog.
The user wants to add
gRaphaël graphs to
       Heard
Graphs are cool.
The user signs up for
      Github.
They go back and
  click “Watch”
Clicks “Fork”
And something
magical happens.
(Parents please make your children
 leave the room or cover their eyes
  during this part of the program.)
We now have our
own fork of Heard.
Forks are copies.
The first step in using
Github after signing up
  is to install git (duh)
This is left as an exercise
      for the reader!
http://git-scm.com
Meanwhile, in our
Account Settings
Sidenote:
What are SSH keys and
 why do I need them?
SSH is a secure communications
method that uses public/private
        key encryption.
You generate two keys:
a public and a private key.
Github knows that only you
   have the private key
So every time we
  communicate with the
 Github server, we don’t
have to type a password!
Generate a key pair
$ ssh-keygen
Generates id_rsa
and id_rsa.pub in
your .ssh/ folder
The .pub file is
the public key
ssh-rsa
AAAAB3NzaC1yc2EAAAABIwAAAQEAx5qfMKhR/
+PQcOw2P/ho36T/
aorbGJxiNwLDjrLenFK122nrdjdAKJtBVqCLd2Doagd0iE
OFFhMhdJ8hNZ3depupx3JAiCswCBMsL4orjfX1suyR5D
A5QyHpf5OGZdKacutlD3l/
CsPq2IH2coQnwlnZTVo6oEBklweTHImx0ElfTaqdYOZZ
+SW4NQ01aj+6jNb4g4D9BqcIcXA/
XDL6B4fi6FtbJo4HlfjAt/
YYOKhxblKYRvBuftfJ0Mrn4Nl1twY5tZ23gDG
+4LZli7fdoFzRN3EjuEhD/
Mg61D1JISQyHDsJQWbOnAdnV3wko8HV9F1D65wp
YprHZqueI2xo4w== mathiasx@banshee.local
Copy this key and paste it
into your Github settings.
We’re now ready to hack!
Go back to our
fork of Heard
$ git clone git@github.com:mathias-presentation/Heard.git
Cloning into Heard...
remote: Counting objects: 22, done.
remote: Compressing objects: 100% (22/22), done.
remote: Total 22 (delta 7), reused 0 (delta 0)
Unpacking objects: 100% (22/22), done.
$ git clone URI
Creates a local version of
the project from the server
$ ls
CHANGELOG	 	 config.php		 table-tracks.sql
LICENSE	 	 	 heardsync.php	 	 tracks.php
README	 	 	 init.php
Now we have the code
The user makes some
changes to the code.
User wants git to track
changes to those files.
For our purposes, the
user finds this command:
$ git commit
$ git commit
# On branch master
# Changed but not updated:
# (use "git add ..." to update what will be committed)
# (use "git checkout -- ..." to discard changes in working
directory)
#
#      modified: config.php
#      modified: init.php
#      modified: tracks.php
#
no changes added to commit (use "git add" and/or "git
commit -a")
Nothing happened.
“no changes added to commit”
Nothing happened?
(use "git add" and/or "git commit -a")
git add filename
git commit -a
The -a is for all
That is, commit everything
that changed in the project.
The user types in
$ git commit -a
And is dropped into..
   a text editor?
Default text editor.
Likely vim on Linux
   or Mac OSX.
To change it to something
   more user-friendly:
$ git config core.editor "nano"
The text editor is for
a commit message.
Git is already tracking the
 exact changes to files.
Your commit message
should be more abstract.
That boils down to
What did you
actually do?
In one line or so.
A good commit message
will help later when you’re
 trying to remember what
          you did.
So now we break the
     narrative.
Show a lot of things happening at once,
remind everyone of what's going on!
And with every shot show a little
improvement,
to show it all would take too long!

That's called a montage! MONTAGE!
Ooh, we want a montage! MONTAGE!
A typical commit:
$ git commit -am "Added the gRaphael library
to be loaded, but haven't integrated it yet."

[master 1a4014f] Added the gRaphael library
to be loaded, but haven't integrated it yet.
 3 files changed, 3 insertions(+), 3 deletions(-)
We don’t have to commit
  all changes at once
[edit some files]
$ git add config.php
$ git add init.php
$ git add filename
git status
$ git status
# On branch master
#
# Changes to be committed:
# (use "git reset HEAD ..." to unstage)
#
#       modified: config.php
#       modified: init.php
#
# Changed but not updated:
# (use "git add ..." to update what will be committed)
# (use "git checkout -- ..." to discard changes in
working directory)
#
#       modified: tracks.php
#
We're only going to commit
    the changes in the
 config.php and init.php
$ git commit -m "A little refactoring."
[master 6dd5c59] A little refactoring.
 2 files changed, 2 insertions(+), 2 deletions(-)
$ git status
# On branch master
#
# Changed but not updated:
# (use "git add ..." to update what will be committed)
# (use "git checkout -- ..." to discard changes in
working directory)
#
#       modified: tracks.php
#
no changes added to commit (use "git add" and/or
"git commit -a")
Notice that tracks.php is still
 waiting to be committed.
The “staging area”
To see the history of
 our project, type:
$ git log
$ git log
commit e47cd6eb917d2a68ec6d1197a38faa1a1ff5e564
Author: Matt Gauger <matt.gauger@gmail.com>
Date: Thu Dec 9 14:27:04 2010 -0600

  Add some newlines after error output.

commit 4cce3dff9c8d03b7db1710f7addaa7d556921a44
Author: raster <pete@rasterweb.net>
Date: Sun Nov 14 11:38:50 2010 -0600

  Minor changes, still learning git

[truncated]
You may be asking
“How do I upload my
changes back to Github?”
$ git push
$ git push
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 335 bytes, done.
Total 3 (delta 2), reused 0 (delta 0)
To git@github.com:mathias/Heard.git
  fb2cc2b..e47cd6e master -> master
And to get changes
 from the server:
$ git fetch
What happens if I
  screw up?
Throw away the
    changes
$ git reset --hard HEAD
Be careful with this,
     obviously
What if I only want to throw
away changes to one file?
$ git checkout -- init.php
$ git checkout HEAD init.php
We’ve covered the most
 common commands.
Now what?
Our user sends a Pull
Request back to Pete.
This asks Pete to merge in
      their changes.
Pete can use the Github
web interface to merge
   those changes in.
Which means our user has
contributed back to Heard,
as they originally intended.
What about GUI clients?
“The commandline is
      scary!”
Mac

•Tower.app: http://www.git-tower.com/
•Gitbox: http://www.gitboxapp.com/
•GitX: http://gitx.frim.nl/
Linux

•git cola: http://cola.tuxfamily.org/
•gitk is included in git-core
•giggle for diffs:
   http://live.gnome.org/giggle
This has been a very brief
    introduction to Git.
Come see me for free
Github stickers after.
Thank you for your time.
Further Reading:

• help.github.com
•gitref.org
•progit.org/book
•www.gitready.com

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Github - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsGithub - Git Training Slides: Foundations
Github - Git Training Slides: Foundations
 
Git - An Introduction
Git - An IntroductionGit - An Introduction
Git - An Introduction
 
Git & GitHub for Beginners
Git & GitHub for BeginnersGit & GitHub for Beginners
Git & GitHub for Beginners
 
Git training v10
Git training v10Git training v10
Git training v10
 
Bitbucket
BitbucketBitbucket
Bitbucket
 
Intro to git and git hub
Intro to git and git hubIntro to git and git hub
Intro to git and git hub
 
Introduction to Git / Github
Introduction to Git / GithubIntroduction to Git / Github
Introduction to Git / Github
 
GitHub Presentation
GitHub PresentationGitHub Presentation
GitHub Presentation
 
Git & Github for beginners
Git & Github for beginnersGit & Github for beginners
Git & Github for beginners
 
The everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitThe everyday developer's guide to version control with Git
The everyday developer's guide to version control with Git
 
Basic Git commands
Basic Git commandsBasic Git commands
Basic Git commands
 
Git and github - Verson Control for the Modern Developer
Git and github - Verson Control for the Modern DeveloperGit and github - Verson Control for the Modern Developer
Git and github - Verson Control for the Modern Developer
 
Intro to Git and GitHub
Intro to Git and GitHubIntro to Git and GitHub
Intro to Git and GitHub
 
Introduction to Git and GitHub
Introduction to Git and GitHubIntroduction to Git and GitHub
Introduction to Git and GitHub
 
GitHub Basics - Derek Bable
GitHub Basics - Derek BableGitHub Basics - Derek Bable
GitHub Basics - Derek Bable
 
Starting with Git & GitHub
Starting with Git & GitHubStarting with Git & GitHub
Starting with Git & GitHub
 
Git basic
Git basicGit basic
Git basic
 
Intro to Git and GitHub
Intro to Git and GitHubIntro to Git and GitHub
Intro to Git and GitHub
 
Nina Zakharenko - Introduction to Git - Start SLC 2015
Nina Zakharenko - Introduction to Git - Start SLC 2015Nina Zakharenko - Introduction to Git - Start SLC 2015
Nina Zakharenko - Introduction to Git - Start SLC 2015
 
Basic Git Intro
Basic Git IntroBasic Git Intro
Basic Git Intro
 

Ähnlich wie Matt Gauger - Git & Github web414 December 2010

Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control System
Victor Wong
 

Ähnlich wie Matt Gauger - Git & Github web414 December 2010 (20)

Introduction to Git for Artists
Introduction to Git for ArtistsIntroduction to Git for Artists
Introduction to Git for Artists
 
Git github
Git githubGit github
Git github
 
Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control System
 
Github By Nyros Developer
Github By Nyros DeveloperGithub By Nyros Developer
Github By Nyros Developer
 
Mastering git - Workflow
Mastering git - WorkflowMastering git - Workflow
Mastering git - Workflow
 
Gittalk
GittalkGittalk
Gittalk
 
Lagos GitHub Meetup - What is Git?
Lagos GitHub Meetup - What is Git?Lagos GitHub Meetup - What is Git?
Lagos GitHub Meetup - What is Git?
 
Git and Github.pptx
Git and Github.pptxGit and Github.pptx
Git and Github.pptx
 
Introduction To Git Workshop
Introduction To Git WorkshopIntroduction To Git Workshop
Introduction To Git Workshop
 
git-commands-cheat-sheet-infopediya-com.pdf
git-commands-cheat-sheet-infopediya-com.pdfgit-commands-cheat-sheet-infopediya-com.pdf
git-commands-cheat-sheet-infopediya-com.pdf
 
GDSC GIT AND GITHUB
GDSC GIT AND GITHUB GDSC GIT AND GITHUB
GDSC GIT AND GITHUB
 
Git_tutorial.pdf
Git_tutorial.pdfGit_tutorial.pdf
Git_tutorial.pdf
 
16 Git
16 Git16 Git
16 Git
 
Bedjango talk about Git & GitHub
Bedjango talk about Git & GitHubBedjango talk about Git & GitHub
Bedjango talk about Git & GitHub
 
Git Init (Introduction to Git)
Git Init (Introduction to Git)Git Init (Introduction to Git)
Git Init (Introduction to Git)
 
GIT in a nutshell
GIT in a nutshellGIT in a nutshell
GIT in a nutshell
 
How to use git without rage
How to use git without rageHow to use git without rage
How to use git without rage
 
Git presentation
Git presentationGit presentation
Git presentation
 
Git Basics (Professionals)
 Git Basics (Professionals) Git Basics (Professionals)
Git Basics (Professionals)
 
Hello, Git!
Hello, Git!Hello, Git!
Hello, Git!
 

Kürzlich hochgeladen

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
 

Kürzlich hochgeladen (20)

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
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
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
 
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
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
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
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
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
 
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...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
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
 
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
 
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
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 

Matt Gauger - Git & Github web414 December 2010

Hinweis der Redaktion

  1. \n
  2. \n
  3. Can you believe it?\n
  4. \n
  5. \n
  6. My name is Matt Gauger. I&amp;#x2019;m a web app developer, Member of the Bucket Brigade. I work upstairs. I&amp;#x2019;ve been using Git since at least the beginning of 2008 \nIf I go too fast or get too quiet, stop me and let me know. Thankyou!\nOk, so first off:\n
  7. In the sense that I use git every day. I love it. But I don&amp;#x2019;t worry about its algorithms for storing changes.\nWe won&amp;#x2019;t go over the low level implementation of git or\ndiscuss the design decisions that make it fast, or any of that. Instead:\n
  8. I&amp;#x2019;ve included plenty of resources at the end to learn from.\n
  9. Feel free to follow along on the websites I&amp;#x2019;m looking at\nand sign up for things as we go along.\nNow, to set the stage, &lt;announcer&gt;imagine a world. A world where one man stands against the code.. &lt;/announcer&gt; No. nothing like that.\n
  10. I&apos;m going to focus on a beginner user\nSomeone who has never contributed to open source\nThey&amp;#x2019;re not trying to learn version control, \nbut they do want to contribute to an open source project\n
  11. Like many of this, this fictional user just wants to get stuff done.\nSo, how do they find git?\n
  12. It&apos;s likely that a person would run into git for the first time by visiting Github. This was not the case a year or two ago.\nThere are a lot of big, popular open source projects hosted there. \nToo many to list here, in fact, but here&apos;s a quick teaser:\n
  13. \n
  14. so you see all those and you have to ask:\n
  15. \n
  16. \n
  17. It certainly has a nice design. \nDesign alone doesn&apos;t necessarily attract developers\nMost of them still use the commandline with bitmap fonts\n
  18. I&apos;ll put forward the theory that \nGithub is popular with developers because it optimizes for the things they need to do\n
  19. It doesn&amp;#x2019;t get in their way.\n
  20. There&amp;#x2019;s very little barrier of entry for a developer \nto contribute back to open source\nto upload new code\nor to find projects that interest them.\n
  21. Let&apos;s assume our beginner has stumbled upon&amp;#xA0;Pete&apos;s blog,\nand read the post about the Heard project\nwhich lets you mirror your Last.fm scrobbles and host it\n
  22. \n
  23. The blog post contains a link to the Github repo, which looks like this:\n
  24. This is the first time the user has been to Github, so they don&apos;t quite know how it works. If the user hovers over the Watch or Fork buttons, they will be instructed to sign in.\n
  25. They might just click the big Download button and never come back, \nbut let&apos;s assume this person wants to hack on the project and contribute back to it.&amp;#xA0;\n
  26. \n
  27. because they&amp;#x2019;re beautiful\nand graphs are cool.\n
  28. \n
  29. \n
  30. \n
  31. \n
  32. But that doesn&amp;#x2019;t seem to do anything except change the text from Watch to Unwatch.\n(They&amp;#x2019;re following the project in their Dashboard to see changes, but our user doesn&amp;#x2019;t\nknow that yet.)\n
  33. \n
  34. \n
  35. \n
  36. As soon as you click the Fork button, you&amp;#x2019;ll see:\n
  37. \n
  38. What&amp;#x2019;s a fork?\n
  39. Forks are copies of a project.\n
  40. \n
  41. \n
  42. \n
  43. \n
  44. We will need to generate an SSH key and enter it into Github to get started.\n
  45. \n
  46. now, you don&amp;#x2019;t really need to understand that part.\n
  47. \n
  48. \n
  49. isn&amp;#x2019;t the magic of cryptography awesome?\n
  50. \n
  51. Our user runs the ssh-keygen command in their shell, after doing some research.\nThis will generate some files in .ssh/\nid_rsa and id_rsa.pub\n
  52. \n
  53. which looks something like this:\n
  54. The text is not important. \nJust remember it is a very unique string that helps Github identify you by your private key.\n
  55. \n
  56. \n
  57. Now, the user is wondering, how do I get the code?\nThat big download button looks awfully enticing.\nBut that&amp;#x2019;s not how you develop and contribute back with git, so let&amp;#x2019;s assume our character knows this.\n
  58. we can copy this URL to the clipboard.\nbut our user doesn&amp;#x2019;t know what it does yet.\n
  59. \n
  60. \n
  61. and if our user cd&amp;#x2019;s (changes directory) into the newly created Heard directory:\n
  62. If the user&apos;s SSH key was right, this will work. \nIf not, they&apos;ll have to go back and fix it. \nLooks like it worked, though, so we&apos;ll move on.\n
  63. The git clone command created a directory named Heard in the user&apos;s home directory. \n
  64. Our user makes some basic changes to the PHP files in their local Heard directory.\n
  65. our user reasons that if git keeps tracks of versions of files, it will need to create a new version containing these changes. further, it will need to be told to track a given change, it doesn&amp;#x2019;t do it automatically.\nGit tracks changes on an object level, not a file or project/directory level. \nYou don&amp;#x2019;t need to understand that concept, but that means git is really smart about what changed and where.\n
  66. \n
  67. The documentation says that the commit command is used to take a snapshot of the code in the current state. That sounds perfect. \nBut typing the command yields:\n
  68. which, to me, after puzzling over it, looks like\n
  69. which we could see in the line:\n
  70. wait a second!\n
  71. that&amp;#x2019;s confusing. why doesn&amp;#x2019;t git see the user&amp;#x2019;s changes?\nluckily, git also includes a helpful pointer at the bottom there:\n
  72. so now we have two more commands to use and figure out.\n
  73. \n
  74. \n
  75. \n
  76. \n
  77. \n
  78. \n
  79. What is going on here? \nThere&amp;#x2019;s very little instruction as to what to do.\nWhat is our user supposed to do with a text editor now?\n
  80. \n
  81. now, vim isn&amp;#x2019;t the most helpful or user-friendly text editor out there, if you don&amp;#x2019;t know it.\nso, I&amp;#x2019;m going to share with you a little spell from the wizards of old.\n
  82. type this:\n
  83. Now, why are we in a text editor? What it is for?\n
  84. \n
  85. that is, git can already show us the files that changed.\nso when we do a commit, we want to leave a message about what we changed and maybe why.\n
  86. than just listing off what files you changed.\n
  87. \n
  88. \n
  89. \n
  90. \n
  91. I want to cover the commands that our fictional user will encounter while working on Heard.\nThis is the Keynote equivilent of a montage:\n
  92. (that&amp;#x2019;s the lyrics from a song on Team America: World Police, if you remember it.)\n
  93. so, let&amp;#x2019;s go do a typical commit and see what it looks like:\n
  94. The git user in me wants to point out two things here:\nFirst, we&amp;#x2019;re committing everything that changed.\nSecond, we&amp;#x2019;re committing to the master branch, you can see it in brackets.\n
  95. remember that git add command?\n
  96. You&apos;ll notice there&apos;s no output from these commands. That&apos;s because nothing has changed yet. Those changes still need to be committed. It would probably be helpful at this point to have a look at what changed and what didn&apos;t. For that, we use the git status command.\n
  97. when we run git status, the output will look like this:\n
  98. you can see we added config.php and init.php with the git add command,\nso those are changes to be committed. Our change to tracks.php is not staged to commit yet.\n
  99. \n
  100. after committing, we do another git status and see tracks.php is still there, modified but not staged, waiting to be committed too\n
  101. \n
  102. This is a very important concept to grasp in git. Maybe you caught it in the last few slides.\nWhen we git add some files, they&amp;#x2019;re added to a pending commit but not committed immediately. Files that aren&amp;#x2019;t staged won&amp;#x2019;t be a part of the commit. This is called the staging area.\n
  103. next up, we want to take a look at the history of our project, that is, the changes that git has tracked.\n
  104. \n
  105. \n
  106. at this point\n
  107. \n
  108. In git, sending changes out to the server is called a push\na more complicated form of git push specifies the server to talk and the branch to use.\nfor our purposes, it will default to our master branch and to github.\n
  109. the output here isn&amp;#x2019;t important\nbut we can see it worked.\n
  110. \n
  111. which again defaults to the default server, which is github.\nthis command will go out and ask github if there are any changes to the project, and pull them down if there are. This is useful if you have two computers and want to get your changes on say, your laptop, after developing on your desktop.\n
  112. that is, what if I saved a file that I didn&amp;#x2019;t mean to save, or I deleted a file I didn&amp;#x2019;t mean to delete? Is git storing it somewhere for me? \nThe answer is Yes. What you want to do is:\n
  113. the command to do that is:\n
  114. \n
  115. \n
  116. \n
  117. which restores init.php to the HEAD state.\nThe HEAD state is just a useful placeholder name for the &amp;#x201C;last commit&amp;#x201D;\nGit has a lot of these placeholder names, learning them is worth it.\n
  118. \n
  119. we go back to github:\n
  120. \n
  121. \n
  122. because, again, the user&amp;#x2019;s github project is a fork of Pete&amp;#x2019;s github project. Pete needs to pull in the user&amp;#x2019;s changes, that is, accept the pull request.\n
  123. \n
  124. \n
  125. \n
  126. \n
  127. \n
  128. \n
  129. \n
  130. \n
  131. \n
  132. if you&amp;#x2019;d like to learn more about git, I highly recommend these sources\n