SlideShare a Scribd company logo
1 of 384
Intro to Git
   Scott Chacon
What is Git?
Git is an open source,
distributed version control
system designed for speed
        and efficiency
Git is an open source,
distributed version control
system designed for speed
       and efficiency
git-scm.com
Git is an open source,
distributed version control
 system designed for speed
        and efficiency
Fully Distributed
(almost) everything is local
which means
which means

everything is fast
which means

   everything is fast

every clone is a backup
which means

   everything is fast

every clone is a backup

     work offline
Git is an open source,
distributed version control
  system designed for
 speed and efficiency
Immutable
(almost) never removes data
Snapshots, not Patches
C1     C2   C3   C4   C5



           file A    1         2
 delta
storage
           file B              1    2



           file C    1    2         3




            C1     C2   C3   C4   C5




snapshot    A      A1   A1   A2   A2

 storage
            B      B    B    B1   B2



            C      C1   C2   C2   C3
C1     C2   C3   C4   C5



           file A    1         2
 delta
storage
           file B              1    2



           file C    1    2         3




            C1     C2   C3   C4   C5




snapshot    A      A1   A1   A2   A2

 storage
            B      B    B    B1   B2



            C      C1   C2   C2   C3
C1     C2   C3   C4   C5



           file A    1         2
 delta
storage
           file B              1    2



           file C    1    2         3




            C1     C2   C3   C4   C5




snapshot    A      A1   A1   A2   A2

 storage
            B      B    B    B1   B2



            C      C1   C2   C2   C3
C1     C2   C3   C4   C5



           file A    1         2
 delta
storage
           file B              1    2



           file C    1    2         3




            C1     C2   C3   C4   C5




snapshot    A      A1   A1   A2   A2

 storage
            B      B    B    B1   B2



            C      C1   C2   C2   C3
C1     C2   C3   C4   C5



           file A    1         2
 delta
storage
           file B              1    2



           file C    1    2         3




            C1     C2   C3   C4   C5




snapshot    A      A1   A1   A2   A2

 storage
            B      B    B    B1   B2



            C      C1   C2   C2   C3
C1     C2   C3   C4   C5



           file A    1         2
 delta
storage
           file B              1    2



           file C    1    2         3




            C1     C2   C3   C4   C5




snapshot    A      A1   A1   A2   A2

 storage
            B      B    B    B1   B2



            C      C1   C2   C2   C3
C1     C2   C3   C4   C5



           file A    1         2
 delta
storage
           file B              1    2



           file C    1    2         3




            C1     C2   C3   C4   C5




snapshot    A      A1   A1   A2   A2

 storage
            B      B    B    B1   B2



            C      C1   C2   C2   C3
C1     C2   C3   C4   C5



           file A    1         2
 delta
storage
           file B              1    2



           file C    1    2         3




            C1     C2   C3   C4   C5




snapshot    A      A1   A1   A2   A2

 storage
            B      B    B    B1   B2



            C      C1   C2   C2   C3
C1     C2   C3   C4   C5



           file A    1         2
 delta
storage
           file B              1    2



           file C    1    2         3




            C1     C2   C3   C4   C5




snapshot    A      A1   A1   A2   A2

 storage
            B      B    B    B1   B2



            C      C1   C2   C2   C3
C1     C2   C3   C4   C5



           file A    1         2
 delta
storage
           file B              1    2



           file C    1    2         3




            C1     C2   C3   C4   C5




snapshot    A      A1   A1   A2   A2

 storage
            B      B    B    B1   B2



            C      C1   C2   C2   C3
C1     C2   C3   C4   C5



           file A    1         2
 delta
storage
           file B              1    2



           file C    1    2         3




            C1     C2   C3   C4   C5




snapshot    A      A1   A1   A2   A2

 storage
            B      B    B    B1   B2



            C      C1   C2   C2   C3
C1     C2   C3   C4   C5



           file A    1         2
 delta
storage
           file B              1    2



           file C    1    2         3




            C1     C2   C3   C4   C5




snapshot    A      A1   A1   A2   A2

 storage
            B      B    B    B1   B2



            C      C1   C2   C2   C3
C1     C2   C3   C4   C5



           file A    1         2
 delta
storage
           file B              1    2



           file C    1    2         3




            C1     C2   C3   C4   C5




snapshot    A      A1   A1   A2   A2

 storage
            B      B    B    B1   B2



            C      C1   C2   C2   C3
C1     C2   C3   C4   C5



           file A    1         2
 delta
storage
           file B              1    2



           file C    1    2         3




            C1     C2   C3   C4   C5




snapshot    A      A1   A1   A2   A2

 storage
            B      B    B    B1   B2



            C      C1   C2   C2   C3
C1     C2   C3   C4   C5



           file A    1         2
 delta
storage
           file B              1    2



           file C    1    2         3




            C1     C2   C3   C4   C5




snapshot    A      A1   A1   A2   A2

 storage
            B      B    B    B1   B2



            C      C1   C2   C2   C3
How is this Different
 Than {cvs|svn|p4}?
Git Ist Schnell!
No Network Needed
No Network Needed
     Performing a diff
No Network Needed
     Performing a diff
    Viewing file history
No Network Needed
     Performing a diff
    Viewing file history
    Committing changes
No Network Needed
     Performing a diff
    Viewing file history
    Committing changes
     Merging branches
No Network Needed
           Performing a diff
         Viewing file history
         Committing changes
          Merging branches
 Obtaining any other revision of a file
No Network Needed
           Performing a diff
         Viewing file history
         Committing changes
          Merging branches
 Obtaining any other revision of a file
         Switching branches
jQuery tests
Work Offline
No .svn Directories
Cheap Branching
$ du -h testrepo/
 78M testrepo/
$ cd testrepo/
$ time git checkout -b newbranch
Switched to a new branch "newbranch"

real 0m0.091s
user 0m0.016s
sys 0m0.023s
$ du -h testrepo/
 78M testrepo/
$ cd testrepo/
$ time git checkout -b newbranch
Switched to a new branch "newbranch"

real 0m0.091s
user 0m0.016s
sys 0m0.023s
$ du -h testrepo/
 78M testrepo/
$ cd testrepo/
$ time git checkout -b newbranch
Switched to a new branch "newbranch"

real 0m0.091s
user 0m0.016s
sys 0m0.023s
$ du -h testrepo/
 78M testrepo/
$ cd testrepo/
$ time git checkout -b newbranch
Switched to a new branch "newbranch"

real 0m0.091s
user 0m0.016s
sys 0m0.023s
$ du -h testrepo/
 78M testrepo/
$ cd testrepo/
$ time git checkout -b newbranch
Switched to a new branch "newbranch"

real 0m0.091s
user 0m0.016s
sys 0m0.023s
$ time cp -Rf testrepo r2

real	0m13.684s
user	0m0.085s
sys	 0m1.215s
Easy Merging
How Do I Use Git?
First Steps
$ git config --global user.name “Scott Chacon”

$ git config --global user.email “schacon@gmail.com”
Getting A Repo
git init
$   touch hello_world.rb
$   git init
$   git add .
$   git commit -m ‘first commit’
$   touch hello_world.rb
$   git init
$   git add .
$   git commit -m ‘first commit’
$ tree -a
.
|-- .git
|   |-- HEAD
|   |-- branches
|   |-- config
|   |-- description
|   |-- hooks
|   |    |-- post-commit.sample
|   |    |-- post-receive.sample
|   |    |-- ...
|   |    |-- pre-rebase.sample
|   |    `-- update.sample
|   |-- info
|   |    `-- exclude
|   |-- objects
|   |    |-- info
|   |    `-- pack
|   |-- refs
|   |    |-- heads
|   |    `-- tags
|   `-- remotes
`-- hello_world.rb

11 directories, 25 files
$ tree -a
.
|-- .git
|   |-- HEAD
|   |-- branches
|   |-- config
|   |-- description
|   |-- hooks
|   |    |-- post-commit.sample
|   |    |-- post-receive.sample
|   |    |-- ...
|   |    |-- pre-rebase.sample
|   |    `-- update.sample
|   |-- info
|   |    `-- exclude
|   |-- objects
|   |    |-- info
|   |    `-- pack
|   |-- refs
|   |    |-- heads
|   |    `-- tags
|   `-- remotes
`-- hello_world.rb

11 directories, 25 files
$ tree -a
.
|-- .git
|   |-- HEAD
|   |-- branches
|   |-- config
|   |-- description
|   |-- hooks
|   |    |-- post-commit.sample
|   |    |-- post-receive.sample
|   |    |-- ...
|   |    |-- pre-rebase.sample
|   |    `-- update.sample
|   |-- info
|   |    `-- exclude
|   |-- objects
|   |    |-- info
|   |    `-- pack
|   |-- refs
|   |    |-- heads
|   |    `-- tags
|   `-- remotes
`-- hello_world.rb

11 directories, 25 files
git clone
$ git clone
$ git clone git://github.com/schacon/grit.git
$ git clone git://github.com/schacon/grit.git mygrit
$ git clone git://github.com/schacon/grit.git mygrit
Initialized empty Git repository in /home/schacon/mygrit/.git/
remote: Counting objects: 3220, done.
remote: Compressing objects: 100% (2093/2093), done.
remote: Total 3220 (delta 1134), reused 3149 (delta 1081)
Receiving objects: 100% (3220/3220), 1.79 MiB | 357 KiB/s, done.
Resolving deltas: 100% (1134/1134), done.
$ git clone git://github.com/schacon/grit.git mygrit
Initialized empty Git repository in /home/schacon/mygrit/.git/
remote: Counting objects: 3220, done.
remote: Compressing objects: 100% (2093/2093), done.
remote: Total 3220 (delta 1134), reused 3149 (delta 1081)
Receiving objects: 100% (3220/3220), 1.79 MiB | 357 KiB/s, done.
Resolving deltas: 100% (1134/1134), done.

$ cd mygrit
$
$ git clone git://github.com/schacon/grit.git mygrit
Initialized empty Git repository in /home/schacon/mygrit/.git/
remote: Counting objects: 3220, done.
remote: Compressing objects: 100% (2093/2093), done.
remote: Total 3220 (delta 1134), reused 3149 (delta 1081)
Receiving objects: 100% (3220/3220), 1.79 MiB | 357 KiB/s, done.
Resolving deltas: 100% (1134/1134), done.

$ cd mygrit
$ ls
API.txt	 	 Manifest.txt	README.txt	 benchmarks.rb	 examples	 lib
History.txt	 PURE_TODO	Rakefile	 benchmarks.txt	 grit.gemspec	test
$
The Git Directory
git init
$ tree -a
.
|-- .git
|   |-- HEAD
|   |-- branches
|   |-- config
|   |-- description
|   |-- hooks
|   |    |-- post-commit.sample
|   |    |-- post-receive.sample
|   |    |-- ...
|   |    |-- pre-rebase.sample
|   |    `-- update.sample
|   |-- info
|   |    `-- exclude
|   |-- objects
|   |    |-- info
|   |    `-- pack
|   |-- refs
|   |    |-- heads
|   |    `-- tags
|   `-- remotes
`-- hello_world.rb

11 directories, 25 files
$ tree -a
.
|-- .git
|   |-- HEAD
|   |-- branches
|   |-- config
|   |-- description
|   |-- hooks
|   |    |-- post-commit.sample
|   |    |-- post-receive.sample
|   |    |-- ...
|   |    |-- pre-rebase.sample
|   |    `-- update.sample
|   |-- info
|   |    `-- exclude
|   |-- objects
|   |    |-- info
|   |    `-- pack
|   |-- refs
|   |    |-- heads
|   |    `-- tags
|   `-- remotes
`-- hello_world.rb

11 directories, 25 files
Areas of Interest
$ tree -a
.
|-- .git
|   |-- HEAD
|   |-- branches
|   |-- config
|   |-- description
|   |-- hooks
|   |    |-- post-commit.sample
|   |    |-- post-receive.sample
|   |    |-- ...
|   |    |-- pre-rebase.sample
|   |    `-- update.sample
|   |-- info
|   |    `-- exclude
|   |-- objects
|   |    |-- info
|   |    `-- pack
|   |-- refs
|   |    |-- heads
|   |    `-- tags
|   `-- remotes
`-- hello_world.rb

11 directories, 25 files
/etc/gitconfig
/etc/gitconfig

~/.gitconfig
/etc/gitconfig

~/.gitconfig

 .git/config
$ tree -a
.
|-- .git
|   |-- HEAD
|   |-- branches
|   |-- config
|   |-- description
|   |-- hooks
|   |    |-- post-commit.sample
|   |    |-- post-receive.sample
|   |    |-- ...
|   |    |-- pre-rebase.sample
|   |    `-- update.sample
|   |-- info
|   |    `-- exclude
|   |-- objects
|   |    |-- info
|   |    `-- pack
|   |-- refs
|   |    |-- heads
|   |    `-- tags
|   `-- remotes
`-- hello_world.rb

11 directories, 25 files
$ tree -a
.
|-- .git
|   |-- HEAD
|   |-- branches
|   |-- config
|   |-- description
|   |-- hooks
|   |    |-- post-commit.sample
|   |    |-- post-receive.sample
|   |    |-- ...
|   |    |-- pre-rebase.sample
|   |    `-- update.sample
|   |-- info
|   |    `-- exclude
|   |-- objects
|   |    |-- info
|   |    `-- pack
|   |-- refs
|   |    |-- heads
|   |    `-- tags
|   `-- remotes
`-- hello_world.rb

11 directories, 25 files
$ tree -a
.
|-- .git
|   |-- HEAD
|   |-- branches
|   |-- config
|   |-- description
|   |-- hooks
|   |    |-- post-commit.sample
|   |    |-- post-receive.sample
|   |    |-- ...
|   |    |-- pre-rebase.sample
|   |    `-- update.sample
|   |-- info
|   |    `-- exclude
|   |-- objects
|   |    |-- info
|   |    `-- pack
|   |-- refs
|   |    |-- heads
|   |    `-- tags
|   `-- remotes
`-- hello_world.rb

11 directories, 25 files
$   touch hello_world.rb
$   git init
$   git add .
$   git commit -m ‘first commit’
$   touch hello_world.rb
$   git init
$   git add .
$   git commit -m ‘first commit’
$ tree -a
.
|-- .git
|   |-- COMMIT_EDITMSG
|   |-- HEAD
|   |-- branches
|   |-- config
|   |-- description
|   |-- hooks
|   |    |-- applypatch-msg.sample
|   |    `-- update.sample
|   |-- index
|   |-- info
|   |    `-- exclude
|   |-- logs
|   |    |-- HEAD
|   |    `-- refs
|   |        `-- heads
|   |             `-- master
|   |-- objects
|   |    |-- 32/09658ac8d80bc9726d3a33d77e3dfc5fe6035e
|   |    |-- 53/9cd7886a627841d525a78d45cbc6396be20b41
|   |    |-- e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391
|   |    |-- info
|   |    `-- pack
|   |-- refs
|   |    |-- heads
|   |    |   `-- master
|   |    `-- tags
|   `-- remotes
`-- hello_world.rb

17 directories, 33 files
$ tree -a
.
|-- .git
|   |-- COMMIT_EDITMSG
|   |-- HEAD
|   |-- branches
|   |-- config
|   |-- description
|   |-- hooks
|   |    |-- applypatch-msg.sample
|   |    `-- update.sample
|   |-- index
|   |-- info
|   |    `-- exclude
|   |-- logs
|   |    |-- HEAD
|   |    `-- refs
|   |        `-- heads
|   |             `-- master
|   |-- objects
|   |    |-- 32/09658ac8d80bc9726d3a33d77e3dfc5fe6035e
|   |    |-- 53/9cd7886a627841d525a78d45cbc6396be20b41
|   |    |-- e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391
|   |    |-- info
|   |    `-- pack
|   |-- refs
|   |    |-- heads
|   |    |   `-- master
|   |    `-- tags
|   `-- remotes
`-- hello_world.rb

17 directories, 33 files
$ tree -a
.
|-- .git
|   |-- COMMIT_EDITMSG
|   |-- HEAD
|   |-- branches
|   |-- config
|   |-- description
|   |-- hooks
|   |    |-- applypatch-msg.sample
|   |    `-- update.sample
|   |-- index
|   |-- info
|   |    `-- exclude
|   |-- logs
|   |    |-- HEAD
|   |    `-- refs
|   |        `-- heads
|   |             `-- master
|   |-- objects
|   |    |-- 32/09658ac8d80bc9726d3a33d77e3dfc5fe6035e
|   |    |-- 53/9cd7886a627841d525a78d45cbc6396be20b41
|   |    |-- e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391
|   |    |-- info
|   |    `-- pack
|   |-- refs
|   |    |-- heads
|   |    |   `-- master
|   |    `-- tags
|   `-- remotes
`-- hello_world.rb

17 directories, 33 files
A Basic Workflow
A Basic Workflow
     Edit files
 Stage the changes
Review your changes
Commit the changes
working directory

git add
            index

                       git commit
          repository
a working copy
      working directory
                           of your project
git add
            index

                       git commit
          repository
working directory

         git add
                       index

                                  git commit

object database      repository
working directory

git add
            index          “staging”
                       git commit
          repository
A Basic Workflow
     Edit files
 Stage the changes
Review your changes
Commit the changes
$ find .
./app.yaml
./index.yaml
./main.py
$ find .
./app.yaml
./index.yaml
./main.py
$ find .
./app.yaml
./index.yaml
./main.py
$ vim main.py
#!/usr/bin/env python
import wsgiref.handlers
from google.appengine.ext import webapp

class MainHandler(webapp.RequestHandler):

  def get(self):
    self.response.out.write('Hello world!')

def main():
  application = webapp.WSGIApplication([('/', MainHandler)],
                                       debug=True)
  wsgiref.handlers.CGIHandler().run(application)

if __name__ == '__main__':
  main()
~
~
"main.py" 16L, 402C
$ vim main.py
#!/usr/bin/env python
import wsgiref.handlers
from google.appengine.ext import webapp

class MainHandler(webapp.RequestHandler):

  def get(self):
    self.response.out.write('Hello world!')

def main():
  application = webapp.WSGIApplication([('/', MainHandler)],
                                       debug=True)
  wsgiref.handlers.CGIHandler().run(application)

if __name__ == '__main__':
  main()
~
~
"main.py" 16L, 402C
$ vim main.py
#!/usr/bin/env python
import wsgiref.handlers
from google.appengine.ext import webapp

class MainHandler(webapp.RequestHandler):

  def get(self):
    self.response.out.write('Hello world!')

def main():
  application = webapp.WSGIApplication([('/', MainHandler)],
                                       debug=True)
  wsgiref.handlers.CGIHandler().run(application)

if __name__ == '__main__':
  main()
~
~
"main.py" 16L, 402C
$ vim main.py
#!/usr/bin/env python
import wsgiref.handlers
from google.appengine.ext import webapp

# this program prints out ‘hello world’

class MainHandler(webapp.RequestHandler):

  def get(self):
    self.response.out.write('Hello world!')

def main():
  application = webapp.WSGIApplication([('/', MainHandler)],
                                       debug=True)
  wsgiref.handlers.CGIHandler().run(application)

if __name__ == '__main__':
  main()
~
~
"main.py" 16L, 402C
$ git status
$ git status
# On branch master
# Changed but not updated:
#   (use "git add <file>..." to update what
#
#	modified:   main.py
#
no changes added to commit (use "git add" an
$ git status
# On branch master
# Changed but not updated:
#   (use "git add <file>..." to update what
#
#	modified:   main.py
#
no changes added to commit (use "git add" an
$ git status
# On branch master
# Changed but not updated:
#   (use "git add <file>..." to update what
#
#	modified:   main.py
#
no changes added to commit (use "git add" an
$ git status
# On branch master
# Changed but not updated:
#   (use "git add <file>..." to update what
#
#	modified:   main.py
#
no changes added to commit (use "git add" an
$ git status
# On branch master
# Changed but not updated:
#   (use "git add <file>..." to update what
#
#	modified:   main.py
#
no changes added to commit (use "git add" an
$ git status
# On branch master
# Changed but not updated:
#   (use "git add <file>..." to update what
#
#	modified:   main.py
#
no changes added to commit (use "git add" an
$ git status
# On branch master
# Changed but not STAGED
                   updated:
#   (use "git add <file>..." to update what
#
#	modified:   main.py
#
no changes added to commit (use "git add" an
$ git status
# On branch master
# Changed but not STAGED
                   updated:
#   (use "git add <file>..." to update what
#
#	modified:   main.py
#
no changes added to commit (use "git add" an
A Basic Workflow
     Edit files
 Stage the changes
Review your changes
Commit the changes
git add
working directory

git add
            index

                       git commit
          repository
working directory

git add
            index

                       git commit
          repository
$ git add main.py
$ git status
# On branch master
# Changes to be committed:
#    (use "git reset HEAD <file>.
#
#	modified:   main.py
#
$ git add main.py
$ git status
# On branch master
# Changes to be committed:
#    (use "git reset HEAD <file>.
#
#	modified:   main.py
#
$ git add main.py
$ git status
# On branch master
# Changes to be committed:
#    (use "git reset HEAD <file>.
#
#	modified:   main.py
#
$ git add main.py
$ git status
# On branch master
# Changes to be committed:
#    (use "git reset HEAD <file>.
#
#	modified:   main.py
#
$ git add main.py
$ git status
# On branch master
# Changes to be committed:
           THAT ARE STAGED
#    (use "git reset HEAD <file>.
#
#	modified:   main.py
#
$ vim app.yaml
application: chacon
version: 1
runtime: python
api_version: 1

handlers:
- url: .*
  script: main.py
~
~
~
"app.yaml" 8L, 101C
$ vim app.yaml
application: chacon
version: 1
runtime: python
api_version: 1

handlers:
- url: .*
  script: main.py
~
~
~
"app.yaml" 8L, 101C
$ vim app.yaml
application: chacon
version: 1
runtime: python
api_version: 1

handlers:
- url: .*
  script: main.py
~
~
~
"app.yaml" 8L, 101C
$ vim app.yaml
application: chacon
version: 1
runtime: python
api_version: 1

handlers:
- url: .*
  script: main.py
~
~
~
"app.yaml" 8L, 101C
$ vim app.yaml
application: chacon
version: 2
runtime: python
api_version: 1

handlers:
- url: .*
  script: main.py
~
~
~
"app.yaml" 8L, 101C
$ git status
# On branch master
# Changes to be committed:
#    (use "git reset HEAD <file>..." to unstage)
#
#	 modified:   main.py
#
# Changed but not updated:
#    (use "git add <file>..." to update what will be com
#
#	 modified:   app.yaml
#
$ git status
# On branch master
# Changes to be committed:
#    (use "git reset HEAD <file>..." to unstage)
#
#	 modified:   main.py
#
# Changed but not updated:
#    (use "git add <file>..." to update what will be com
#
#	 modified:   app.yaml
#
$ git status
# On branch master
# Changes to be committed:
#    (use "git reset HEAD <file>..." to unstage)
#
#	 modified:   main.py
#
# Changed but not updated:
#    (use "git add <file>..." to update what will be com
#
#	 modified:   app.yaml
#
$ vim main.py
#!/usr/bin/env python
import wsgiref.handlers
from google.appengine.ext import webapp

# this program prints out ‘hello world’

class MainHandler(webapp.RequestHandler):

  def get(self):
    self.response.out.write('Hello world!')

def main():
  application = webapp.WSGIApplication([('/', MainHandler)],
                                       debug=True)
  wsgiref.handlers.CGIHandler().run(application)

if __name__ == '__main__':
  main()
~
~
"main.py" 16L, 402C
$ vim main.py
#!/usr/bin/env python
import wsgiref.handlers
from google.appengine.ext import webapp

# this program prints out ‘hello world’

class MainHandler(webapp.RequestHandler):

  def get(self):
    self.response.out.write('Hello world!')

def main():
  application = webapp.WSGIApplication([('/', MainHandler)],
                                       debug=True)
  wsgiref.handlers.CGIHandler().run(application)

if __name__ == '__main__':
  main()
~
~
"main.py" 16L, 402C
$ vim main.py
#!/usr/bin/env python
import wsgiref.handlers
from google.appengine.ext import webapp

# this program prints out ‘hello world’

class MainHandler(webapp.RequestHandler):

  def get(self):
    self.response.out.write('Hello world!')

def main():
  application = webapp.WSGIApplication([('/', MainHandler)],
                                       debug=True)
  wsgiref.handlers.CGIHandler().run(application)

if __name__ == '__main__':
  main()
~
~
"main.py" 16L, 402C
$ vim main.py
#!/usr/bin/env python
import wsgiref.handlers
from google.appengine.ext import webapp

# this program prints out ‘hello world’

class MainHandler(webapp.RequestHandler):

  def get(self):
    self.response.out.write('Hola world!')

def main():
  application = webapp.WSGIApplication([('/', MainHandler)],
                                       debug=True)
  wsgiref.handlers.CGIHandler().run(application)

if __name__ == '__main__':
  main()
~
~
"main.py" 16L, 402C
$ vim main.py
#!/usr/bin/env python
import wsgiref.handlers
from google.appengine.ext import webapp

# this program prints out ‘hello world’

class MainHandler(webapp.RequestHandler):

  def get(self):
    self.response.out.write('Hola Mundo!')

def main():
  application = webapp.WSGIApplication([('/', MainHandler)],
                                       debug=True)
  wsgiref.handlers.CGIHandler().run(application)

if __name__ == '__main__':
  main()
~
~
"main.py" 16L, 402C
$ git status
# On branch master
# Changes to be committed:
#    (use "git reset HEAD <file>..." to unstage)
#
#	 modified:   main.py
#
# Changed but not updated:
#    (use "git add <file>..." to update what will be com
#
#	 modified:   app.yaml
#	 modified:   main.py
#
$ git status
# On branch master
# Changes to be committed:
#    (use "git reset HEAD <file>..." to unstage)
#
#	 modified:   main.py
#
# Changed but not updated:
#    (use "git add <file>..." to update what will be com
#
#	 modified:   app.yaml
#	 modified:   main.py
#
$ git status
# On branch master
# Changes to be committed:
#    (use "git reset HEAD <file>..." to unstage)
#
#	 modified:   main.py
#
# Changed but not updated:
#    (use "git add <file>..." to update what will be com
#
#	 modified:   app.yaml
#	 modified:   main.py
#
$ git status
         # On branch master
         # Changes to be committed:
Staged   #    (use "git reset HEAD <file>..." to unstage)
         #
         #	 modified:    main.py
         #
         # Changed but not updated:
         #    (use "git add <file>..." to update what will be com
         #
         #	 modified:    app.yaml
         #	 modified:    main.py
         #
$ git status
           # On branch master
           # Changes to be committed:
           #    (use "git reset HEAD <file>..." to unstage)
           #
           #	 modified:    main.py
           #
           # Changed but not updated:
Unstaged   #
           #
                (use "git add <file>..." to update what will be com

           #	 modified:    app.yaml
           #	 modified:    main.py
           #
$ git status
# On branch master
# Changes to be committed:
#    (use "git reset HEAD <file>..." to unstage)
#
#	 modified:    main.py
#
# Changed but not updated:
#    (use "git add <file>..." to update what will be com
#
#	 modified:    app.yaml
#	 modified:    main.py
#
Staged                             In Working Directory
#!/usr/bin/env python                         #!/usr/bin/env python
import wsgiref.handlers                       import wsgiref.handlers
from google.appengine.ext import webapp       from google.appengine.ext import webapp

# this program prints out ‘hello world’       # this program prints out ‘hello world’

class MainHandler(webapp.RequestHandler):     class MainHandler(webapp.RequestHandler):

  def get(self):                                def get(self):
    self.response.out.write('Hello World!')       self.response.out.write('Hola Mundo!')

def main():                                   def main():
  application =                                 application =
webapp.WSGIApplication([('/'                  webapp.WSGIApplication([('/'
debug=True)                                   debug=True)

wsgiref.handlers.CGIHandler().run(applicat    wsgiref.handlers.CGIHandler().run(applicat

if __name__ == '__main__':                    if __name__ == '__main__':
  main()                                        main()
Staged                             In Working Directory
#!/usr/bin/env python                         #!/usr/bin/env python
import wsgiref.handlers                       import wsgiref.handlers
from google.appengine.ext import webapp       from google.appengine.ext import webapp

# this program prints out ‘hello world’       # this program prints out ‘hello world’

class MainHandler(webapp.RequestHandler):     class MainHandler(webapp.RequestHandler):

  def get(self):                                def get(self):
    self.response.out.write('Hello World!')       self.response.out.write('Hola Mundo!')

def main():                                   def main():
  application =                                 application =
webapp.WSGIApplication([('/'                  webapp.WSGIApplication([('/'
debug=True)                                   debug=True)

wsgiref.handlers.CGIHandler().run(applicat    wsgiref.handlers.CGIHandler().run(applicat

if __name__ == '__main__':                    if __name__ == '__main__':
  main()                                        main()
You have to stage a file
   after you edit it
You have to stage a file
  after you edit it
You have to stage a file
  after you edit it
$ git add app.yaml main.py
$ git status
# On branch master
# Changes to be committed:
#    (use "git reset HEAD <file>..." to unstage)
#
#	 modified:   app.yaml
#	 modified:   main.py
#
$ git add app.yaml main.py
$ git status
# On branch master
# Changes to be committed:
#    (use "git reset HEAD <file>..." to unstage)
#
#	 modified:   app.yaml
#	 modified:   main.py
#
$ git add app.yaml main.py
$ git status
# On branch master
# Changes to be committed:
#    (use "git reset HEAD <file>..." to unstage)
#
#	 modified:   app.yaml
#	 modified:   main.py
#
A Basic Workflow
     Edit files
 Stage the changes
Review your changes
Commit the changes
git
commit
working directory

git add
            index

                       git commit
          repository
working directory

git add
            index

                       git commit
          repository
$ git commit

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       modified:   app.yaml
#       modified:   main.py
#
~
~
~
~
".git/COMMIT_EDITMSG" 10L, 279C
$ git commit

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       modified:   app.yaml
#       modified:   main.py
#
~
~
~
~
".git/COMMIT_EDITMSG" 10L, 279C
$ git commit

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       modified:   app.yaml
#       modified:   main.py
#
~
~
~
~
".git/COMMIT_EDITMSG" 10L, 279C
$ git commit

descriptive commit message
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       modified:   app.yaml
#       modified:   main.py
#
~
~
~
~
".git/COMMIT_EDITMSG" 10L, 279C
$ git commit

descriptive commit message
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       modified:   app.yaml
#       modified:   main.py
#
~
~
~
~
".git/COMMIT_EDITMSG" 10L, 279C
$ git commit
Created commit 77d3001: descriptive commit message
 2 files changed, 4 insertions(+), 2 deletions(-)
A Basic Workflow
     Edit files        vim / emacs / etc
 Stage the changes      git add (file)
Review your changes     repo status
Commit the changes       git commit
A Basic Workflow
     Edit files        vim / emacs / etc
 Stage the changes      git add (file)
Review your changes     repo status
Commit the changes       git commit
A Basic Workflow
     Edit files        vim / emacs / etc
 Stage the changes      git add (file)
Review your changes     repo status
Commit the changes       git commit
A Basic Workflow
     Edit files        vim / emacs / etc
 Stage the changes      git add (file)
Review your changes       git status
Commit the changes       git commit
A Basic Workflow
     Edit files        vim / emacs / etc
 Stage the changes      git add (file)
Review your changes       git status
Commit the changes       git commit
cheating...
A Basicerer Workflow

     Edit files       vim / emacs / etc
Commit the changes      git commit
A Basicerer Workflow

         Edit files           vim / emacs / etc
Stage & commit the changes    git commit -a
A Basicerer Workflow

         Edit files           vim / emacs / etc
Stage & commit the changes    git commit -a
What’s going on here?
$ git commit
Created commit 77d3001: descriptive commit message
 2 files changed, 4 insertions(+), 2 deletions(-)
$ git commit
Created commit 77d3001: descriptive commit message
 2 files changed, 4 insertions(+), 2 deletions(-)
77d3001
77d3001
77d3001a1de6bf8f5e431972fe4d25b01e595c0b
77d3001a1de6bf8f5e431972fe4d25b01e595c0b
77d3001a1de6bf8f5e431972fe4d25b01e595c0b
77d3001a1de6bf8f5e431972fe4d25b01e595c0b
                  ae668..
               commit               size
                 tree         c4ec5
                parent        a149e
                author        Scott
               committer      Scott
               my commit message goes here
               and it is really, really cool
77d3001a1de6bf8f5e431972fe4d25b01e595c0b
                   ae668..
                     commit        size
tree c4ec543b0322744e55c5efc9b6c4e449d398dbff
parent a149e2160b3f7573768cdc2fce24d0881f3577e1
                       tree    c4ec5
author Scott Chacon <schacon@gmail.com> 1223402504 -0700
committer Scott Chaconparent
                        <schacon@gmail.com> 1223402504 -0700
                               a149e
                      author   Scott
descriptive commit message
                     committer Scott
                     my commit message goes here
                     and it is really, really cool
77d3001a1de6bf8f5e431972fe4d25b01e595c0b
                  ae668..
               commit               size
                 tree         c4ec5
                parent        a149e
                author        Scott
               committer      Scott
               my commit message goes here
               and it is really, really cool
77d3001a1de6bf8f5e431972fe4d25b01e595c0b
                  ae668..
               commit                 size
                 tree           c4ec5
                parent          a149e
                author          Scott
               committer        Scott
               my commit message goes here
               and it is really, really cool




                         ./         c4e



                              app.yaml       3d5



                              index.yaml     1d3



                               main.py       03e
ae668..
                              commit                 size
commit               size
  tree         2de54
                                tree           c4ec5
 parent        38def           parent          a149e
 author        Scott
                               author          Scott
committer      Scott
this is the previous commit   committer        Scott
and I am very proud of it
                              my commit message goes here
                              and it is really, really cool




                                        ./         c4e



                                             app.yaml       3d5



                                             index.yaml     1d3



                                              main.py       03e
ae668..
                                 commit                 size
commit                    size
  tree            2de54
                                   tree           c4ec5
 parent           38def           parent          a149e
 author           Scott
                                  author          Scott
committer         Scott
this is the previous commit      committer        Scott
and I am very proud of it
                                 my commit message goes here
                                 and it is really, really cool


        ./         c4e



             app.yaml     3d5



             index.yaml   1d3              ./         c4e

              main.py     03e



                                                app.yaml       3d5



                                                index.yaml     1d3



                                                 main.py       03e
ae668..
                                                                                                   commit                 size
                                                                  commit                    size
commit                    size
                                 commit                    size
                                                                    tree            2de54
                                                                                                     tree           c4ec5
                                   tree            2fe65
  tree
 parent
 author
                  2fe65
                  90ecd           parent           90ecd           parent           38def           parent          a149e
                  Scott
                                  author           Scott
                                                                   author
                                                                                                    author
committer         Scott
                                 committer                                          Scott
this is the commit before that
and I'm not sure why
                                                   Scott
                                                                                                                    Scott
                                 this is the commit before that
                                 and I'm not sure why             committer         Scott
                                                                  this is the previous commit      committer        Scott
                                                                  and I am very proud of it
        ./         c4e



             app.yaml     3d5
                                                                                                   my commit message goes here
                                         ./         c4e

             index.yaml   1d3
                                                                                                   and it is really, really cool
                                              app.yaml     3d5
              main.py     03e




                                              index.yaml   1d3
                                                                          ./         c4e
                                               main.py     03e



                                                                               app.yaml     3d5



                                                                               index.yaml   1d3              ./         c4e

                                                                                main.py     03e



                                                                                                                  app.yaml       3d5



                                                                                                                  index.yaml     1d3



                                                                                                                   main.py       03e
ae668..
                                                                                                   commit                 size
                                                                  commit                    size
commit                    size
                                 commit                    size
                                                                    tree            2de54
                                                                                                     tree           c4ec5
                                   tree    2fe65
  tree
 parent
 author
             48e
                  2fe65
               90ecd              parent 38d
                                           90ecd                   parent       a14
                                                                                  38def             parent        77d
                                                                                                                    a149e
                  Scott
                                  author   Scott
                                                                   author
                                                                                                    author
committer         Scott
                                 committer                                          Scott
this is the commit before that
and I'm not sure why
                                                   Scott
                                                                                                                    Scott
                                 this is the commit before that
                                 and I'm not sure why             committer         Scott
                                                                  this is the previous commit      committer        Scott
                                                                  and I am very proud of it
        ./         c4e



                          3d5
                                                                                                   my commit message goes here
                                                   32a
             app.yaml                               c4e
                                         ./

             index.yaml   1d3
                                                                                                   and it is really, really cool
                                              app.yaml     3d5
              main.py     03e




                                              index.yaml   5b1
                                                           1d3
                                                                                     c4e
                                                                          ./         f46
                                               main.py     03e



                                                                               app.yaml     23f
                                                                                            3d5



                                                                               index.yaml   30e
                                                                                            1d3              ./         c4e

                                                                                main.py     67e
                                                                                            03e



                                                                                                                  app.yaml       3d5



                                                                                                                  index.yaml     1d3



                                                                                                                   main.py       03e
                                                                                                                                 03e
48e

32a
                                                                                                                           ae668..
                                            f46


23f               30e                                                                                                commit                 size
                                             67e                                    commit                    size
                                                   commit                    size
                                                                                      tree
                                                                                                                       tree           c4ec5
c4e         commit                    size
                                                     tree            2fe65
                                                                                                      2de54
              tree
             parent
             author
                              2fe65
                              90ecd                 parent           90ecd           parent           38def           parent          a149e
                              Scott
                                                    author           Scott
                                                                                     author
                                                                                                                      author
            committer         Scott
                                                   committer                                          Scott
            this is the commit before that
            and I'm not sure why
                                                                     Scott
                                                                                                                                      Scott
                                                   this is the commit before that
                                                   and I'm not sure why             committer         Scott
 3d5
                                       1d3
                                                                                    this is the previous commit      committer        Scott
                                                                                    and I am very proud of it
                    ./         c4e



                         app.yaml     3d5
                                                                                                                     my commit message goes here
                                                           ./         c4e

                         index.yaml   1d3
                                                                                                                     and it is really, really cool
                                                                app.yaml     3d5

                                       a14
                          main.py     03e




      03e                                                       index.yaml   1d3
                                                                                            ./         c4e
                                                                 main.py     03e



                                                                                                 app.yaml     3d5

      38d                                    5b1
                                                                                                 index.yaml   1d3              ./         c4e

  77d                                                                                             main.py     03e



                                                                                                                                    app.yaml       3d5



                                                                                                                                    index.yaml     1d3



                                                                                                                                     main.py       03e
Repository

5b1   32a   c36

1d3   f46   3d4

ffe   6fe   ae6

38d   23f   03e

254   30e   5b1

a14   67e   1d3

3d5   735   d23

c4e   c4e   48e

77d   de3   2d3
Repository

5b1   32a   c36

1d3   f46   3d4

ffe   6fe   ae6
                  git checkout ae635
38d   23f   03e

254   30e   5b1

a14   67e   1d3

3d5   735   d23

c4e   c4e   48e

77d   de3   2d3
Repository

5b1   32a   c36

1d3   f46   3d4

ffe   6fe   ae6
                  git checkout ae635
38d   23f   03e

254   30e   5b1

a14   67e   1d3

3d5   735   d23

c4e   c4e   48e

77d   de3   2d3
Repository             Index               Working Directory

5b1   32a   c36
                  ./                3d4         ./
1d3   f46   3d4

ffe   6fe   ae6   ./Rakefile         1d3              Rakefile

38d   23f   03e
                  ./README          03e              README
254   30e   5b1

a14   67e   1d3
                  ./lib/            c36                lib/
3d5   735   d23

c4e   c4e   48e   ./lib/simplegit.rb 5b1                  simplegit.rb

77d   de3   2d3
Repository             Index               Working Directory

5b1   32a   c36
                  ./                3d4         ./
1d3   f46   3d4

ffe   6fe   ae6   ./Rakefile         1d3              Rakefile

38d   23f   03e
                  ./README          03e              README
254   30e   5b1

a14   67e   1d3
                  ./lib/            c36                lib/
3d5   735   d23

c4e   c4e   48e   ./lib/simplegit.rb 5b1                  simplegit.rb

77d   de3   2d3
Repository             Index               Working Directory

5b1   32a   c36
                  ./                3d4         ./
1d3   f46   3d4

ffe   6fe   ae6   ./Rakefile         1d3              Rakefile

38d   23f   03e
                  ./README          03e              README
254   30e   5b1

a14   67e   1d3
                  ./lib/            c36                lib/
3d5   735   d23

c4e   c4e   48e   ./lib/simplegit.rb 5b1                  simplegit.rb

77d   de3   2d3
Repository             Index               Working Directory

5b1   32a   c36
                  ./                3d4         ./
1d3   f46   3d4

ffe   6fe   ae6   ./Rakefile         1d3              Rakefile

38d   23f   03e
                  ./README          03e              README
254   30e   5b1

a14   67e   1d3
                  ./lib/            c36                lib/
3d5   735   d23

c4e   c4e   48e   ./lib/simplegit.rb 5b1                  simplegit.rb

77d   de3   2d3
Repository             Index               Working Directory

5b1   32a   c36
                  ./                3d4         ./
1d3   f46   3d4

ffe   6fe   ae6   ./Rakefile         1d3              Rakefile

38d   23f   03e
                  ./README          03e              README
254   30e   5b1

a14   67e   1d3
                  ./lib/            c36                lib/
3d5   735   d23

c4e   c4e   48e   ./lib/simplegit.rb 5b1                  simplegit.rb

77d   de3   2d3




                                           git add
Repository             Index               Working Directory

5b1   32a   c36
                  ./                3d4         ./
1d3   f46   3d4

ffe   6fe   ae6   ./Rakefile         1d3              Rakefile
                                     34f
38d   23f   03e
                  ./README          03e              README
254   30e   5b1

a14   67e   1d3
                  ./lib/            c36                lib/
3d5   735   d23

c4e   c4e   48e   ./lib/simplegit.rb 5b1                  simplegit.rb

77d   de3   2d3




                                           git add
Repository               Index               Working Directory

5b1   32a   c36
                    ./                3d4         ./
1d3   f46   3d4

ffe   6fe   ae6     ./Rakefile         1d3
                                      34f              Rakefile

38d   23f   03e
                    ./README          03e              README
254   30e   5b1

a14   67e   1d3
                    ./lib/            c36                lib/
3d5   735   d23

c4e   c4e   48e     ./lib/simplegit.rb 5b1                  simplegit.rb

77d   de3   2d3

34f   3da   a08

ae9




                  git commit
Repository             Index               Working Directory

5b1   32a   c36
                  ./                3d4         ./
1d3   f46   3d4

ffe   6fe   ae6   ./Rakefile         1d3
                                    34f              Rakefile

38d   23f   03e
                  ./README          03e              README
254   30e   5b1

a14   67e   1d3
                  ./lib/            c36                lib/
3d5   735   d23

c4e   c4e   48e   ./lib/simplegit.rb 5b1                  simplegit.rb

77d   de3   2d3

34f   3da   a08

ae9
Repository             Index               Working Directory

5b1   32a   c36
                  ./                3d4         ./
1d3   f46   3d4

ffe   6fe   ae6   ./Rakefile         1d3
                                    34f              Rakefile

38d   23f   03e
                  ./README          03e              README
254   30e   5b1

a14   67e   1d3
                  ./lib/            c36                lib/
3d5   735   d23

c4e   c4e   48e   ./lib/simplegit.rb 5b1                  simplegit.rb

77d   de3   2d3

34f   3da   a08

ae9
object model
  commit




   tree




   blob
           }   C1
object model
pointer to a       commit




                            }
 snapshot


                                C1
directory list      tree




file contents        blob
object model
pointer to a       commit




                            }
 snapshot


                                C1
directory list      tree




file contents        blob
Branching and Merging
branches
branches
lightweight, movable
pointers to a commit



      branch



        C1
branching
git branch
git checkout
HEAD



     default
     master         experiment




C0     C1




               C2      C3
HEAD


 C4
      default
      master       experiment




C3
C0       C5
        C1




              C2
      experiment      C3




      git branch experiment
HEAD


 C4
      default
      master       experiment




C3
C0       C5
        C1




              C2
      experiment      C3




      git branch experiment
HEAD


 C4
      default
      master       experiment


                           $ git branch
C3
C0       C5
        C1                 * default
                             experiment

              C2
      experiment      C3
HEAD


 C4
      default
      master       experiment


                           $ git branch
C3
C0       C5
        C1                 * default
                             experiment

              C2
      experiment      C3
C4
       default
       master      experiment




C3
C0        C5
         C1




              C2
      experiment      C3


        HEAD




      git checkout experiment
T1          master
               default
               master              experiment


                                           git commit
    C0    C4 C1




2        C3              C5
                         C2           C3




                   experiment



                     HEAD
T1          master
               default
               master              experiment


                                           git commit
    C0    C4 C1




2        C3              C5
                         C2           C3




                   experiment



                     HEAD
T1          master
               default
               master              experiment


                                           git commit
    C0    C4 C1




2        C3              C5
                         C2           C3




                   experiment



                     HEAD
T1          master
           default
           master               experiment


                                         git commit
C1
 C0          C1        C4
                                         git commit

      C2              C3
                     C2            C5
                                   C3




                                experiment



                                  HEAD
HEAD


                           T1
           default
           master               git checkout default
                                        master
                                 experiment




C1
 C0          C1        C4




      C2              C3
                     C2             C5
                                    C3




                                 experiment
HEAD


                           T1
           default
           master               git checkout default
                                        master
                                 experiment




C1
 C0          C1        C4




      C2              C3
                     C2             C5
                                    C3




                                 experiment
git commit
            T1              T1
                            master       default
                                         master



                                           HEAD

C1
C0        C1     C4         C4




     C2         C3
               C2        C5
                         C3           C5




                      experiment   experiment
git commit
            T1              T1
                            master       default
                                         master



                                           HEAD

C1
C0        C1     C4         C4




     C2         C3
               C2        C5
                         C3           C5




                      experiment   experiment
git commit
            T1              T1
                            master       default
                                         master



                                           HEAD

C1
C0        C1     C4         C4




     C2         C3
               C2        C5
                         C3           C5




                      experiment   experiment
T1         default
                                          master




  C0        C1             C4




                 C2       C3           C5




git checkout experiment             experiment

       git commit
                                      HEAD
merging
git merge
T1         default
                               master




C0   C1         C4




          C2   C3           C5




                         experiment



                           HEAD
HEAD



                            T1         default
                                       master




C0        C1            C4




                C2     C3           C5




git checkout default             experiment
HEAD



                             T1                master
                                               default




 C0        C1                C4                 C6




                C2      C3           C5




 git checkout default             experiment

git merge experiment
HEAD



                             T1                master
                                               default




 C0        C1                C4                 C6




                C2      C3           C5




 git checkout default             experiment

git merge experiment
default




 C0      C1                C4                 C6            C8




              C2      C3           C5                  C7



                                experiment



git checkout experiment           HEAD
default




C0        C1             C4         C6             C8




               C2   C3        C5             C7



                                      experiment



     git commit                          HEAD
HEAD


                                      default




C0     C1                   C4         C6             C8




            C2         C3        C5             C7



                                         experiment



git checkout default
HEAD


                                                   default




C0     C1                   C4        C6            C8




            C2         C3        C5        C7



                                      experiment



git merge experiment
Hot
3 Way Merge
   Action
master




C0   C1         C4




          C2   C3          C5




                        experiment
master




C0   C1         C4




          C2   C3          C5




                        experiment
C0   C1             C4        C6




          C2   C3        C5        C7
C0   C1             C4        C6




          C2   C3        C5        C7
C0   C1             C4        C6




          C2   C3        C5        C7
Remotes
Distributed Workflow
local repo




           public repo                public repo




internet




                         local repo


                         A   B    C
local repo




               public repo                 public repo


           A   B   C

internet

                   git push
                    (ssh)


                              local repo


                              A   B    C
local repo



                   git fetch   A   B    C

                     (git)



               public repo                  public repo


           A   B   C

internet

                   git push
                    (ssh)


                               local repo


                               A   B    C
local repo



                   git fetch   A   B    C

                     (git)     D   E    F   git commit



               public repo                    public repo


           A   B   C

internet

                   git push
                    (ssh)


                               local repo


                               A   B    C
local repo



                   git fetch   A   B    C   git push
                     (git)     D   E    F    (ssh)



               public repo                  public repo


           A   B   C                           A   B      C

internet                                       D   E      F




                   git push
                    (ssh)


                               local repo


                               A   B    C
local repo



                   git fetch   A   B    C   git push
                     (git)     D   E    F    (ssh)



               public repo                  public repo


           A   B   C                           A   B      C

internet                                       D   E      F




                   git push                 git fetch
                    (ssh)                    (http)


                               local repo


                               A   B    C

                               D   E    F
local repo



                   git fetch   A   B    C   git push
                     (git)     D   E    F    (ssh)



               public repo                  public repo


           A   B   C                           A   B      C

internet   D   E   F                           D   E      F




                   git push                 git fetch
                    (ssh)                    (http)


                               local repo


                               A   B    C

                               D   E    F
Multiple Remotes
developer                               developer
  nick                                   jessica




                      ce0   4a7   5ec    master

            my repo   e4a
developer                               developer
  nick                                   jessica




                            commit
                      ce0   4a7   5ec    master

            my repo   e4a
developer                                developer
  nick                                    jessica




                            tree
                      ce0    4a7   5ec    master

            my repo   e4a
developer                                developer
  nick                                    jessica




                      blobs
                       ce0   4a7   5ec    master

            my repo    e4a
developer                                       developer
  nick                                           jessica




                              ce0   4a7   5ec
                   schacon/
                              e4a
                    project

                   "public"




 git push public
                              ce0   4a7   5ec    master

                   my repo    e4a                public/master
ce0   4a7   5ec
developer                                                  developer
            e4a
  nick                                                      jessica


                              git clone (url)

                                         ce0   4a7   5ec
                              schacon/
                                         e4a
                               project

                              "public"




                                         ce0   4a7   5ec    master

                              my repo    e4a                public/master
ce0   4a7   5ec
developer                                                  developer
            e4a
  nick                                                      jessica
            24f   ec5   c12



                               git commit

                                         ce0   4a7   5ec
                              schacon/
                                         e4a
                               project

                              "public"




                                         ce0   4a7   5ec    master

                              my repo    e4a                public/master
ce0   4a7   5ec                                                 ce0   4a7   5ec
developer                                                  developer
            e4a                                                             e4a
  nick
            24f   ec5   c12   git clone (url)               jessica




                                         ce0   4a7   5ec
                              schacon/
                                         e4a
                               project

                              "public"




                                         ce0   4a7   5ec    master

                              my repo    e4a                public/master
ce0   4a7   5ec                                                 ce0   4a7   5ec
developer                                                  developer
            e4a                                                             e4a
  nick                                                      jessica
            24f   ec5   c12                                                 4ea   df7   2fb

                                 git commit                                 a09




                                         ce0   4a7   5ec
                              schacon/
                                         e4a
                               project

                              "public"




                                         ce0   4a7   5ec    master

                              my repo    e4a                public/master
ce0   4a7   5ec                                                ce0   4a7   5ec
developer                                                  developer
            e4a                                                            e4a
  nick                                                      jessica
            24f   ec5   c12                                                4ea   df7   2fb

                                   git push                                a09




            ce0   4a7   5ec              ce0   4a7   5ec                   ce0   4a7   5ec
 nickh/                       schacon/                      jessica/
            e4a                          e4a                               e4a
 project                       project                       project
            24f   ec5   c12                                                4ea   df7   2fb
                              "public"                                     a09




                                         ce0   4a7   5ec   master

                              my repo    e4a               public/master
ce0   4a7   5ec                                                ce0   4a7   5ec
developer                                                  developer
            e4a                                                            e4a
  nick                                                      jessica
            24f   ec5   c12                                                4ea   df7   2fb
                                                                           a09




            ce0   4a7   5ec              ce0   4a7   5ec                   ce0   4a7   5ec
 nickh/                       schacon/                      jessica/
            e4a                          e4a                               e4a
 project                       project                       project
            24f   ec5   c12                                                4ea   df7   2fb
 "nick"                       "public"                                     a09




                                         ce0   4a7   5ec   master

                              my repo    e4a               public/master




git remote add nicknick git://github.com/nickh/project.git
       git remote add git://github.com/nickh/project.git
ce0   4a7   5ec                                                ce0   4a7   5ec
developer                                                  developer
            e4a                                                            e4a
  nick                                                      jessica
            24f   ec5   c12                                                4ea   df7   2fb
                                                                           a09




            ce0   4a7   5ec              ce0   4a7   5ec                   ce0   4a7   5ec
 nickh/                       schacon/                      jessica/
            e4a                          e4a                               e4a
 project                       project                       project
            24f   ec5   c12                                                4ea   df7   2fb

“nick”
 "nick"                       "public"                                     a09




                                         ce0   4a7   5ec   master

                              my repo    e4a               public/master




git remote add nicknick git://github.com/nickh/project.git
       git remote add git://github.com/nickh/project.git
ce0   4a7   5ec                                                ce0   4a7   5ec
developer                                                  developer
            e4a                                                            e4a
  nick                                                      jessica
            24f   ec5   c12                                                4ea   df7   2fb
                                                                           a09




            ce0   4a7   5ec              ce0   4a7   5ec                   ce0   4a7   5ec
 nickh/                       schacon/                      jessica/
            e4a                          e4a                               e4a
 project                       project                       project
            24f   ec5   c12                                                4ea   df7   2fb
 "nick"                       "public"                      "jess"         a09




                                         ce0   4a7   5ec   master

                              my repo    e4a               public/master




git remote add add jess git://github.com/jessica/project.git
       git remote jess git://github.com/jessica/project.git
ce0   4a7   5ec                                                 ce0   4a7   5ec
developer                                                  developer
            e4a                                                             e4a
  nick                                                      jessica
            24f   ec5   c12                                                 4ea   df7   2fb
                                                                            a09




            ce0   4a7   5ec              ce0   4a7   5ec                    ce0   4a7   5ec
 nickh/                       schacon/                      jessica/
            e4a                          e4a                                e4a
 project                       project                       project
            24f   ec5   c12                                                 4ea   df7   2fb
 "nick"                       "public"                     “jess”
                                                             "jess"         a09




                                         ce0   4a7   5ec   master

                              my repo    e4a                public/master




git remote add add jess git://github.com/jessica/project.git
       git remote jess git://github.com/jessica/project.git
5ec                ce0   4a7   5ec                   ce0   4a7   5ec
      schacon/                        jessica/
                   e4a                               e4a
       project     ce0   4a7   5ec     project                                         ce0   4a7   5ec
c12   developer                                      4ea   df7   2fb   developer
                   e4a                                                                 e4a
      "public"
         nick                          "jess"        a09                jessica
                   24f   ec5   c12                                                     4ea   df7   2fb
                                                                                       a09




                   ce0   4a7   5ec   master          ce0   4a7   5ec                   ce0   4a7   5ec
       nickh/                         schacon/                          jessica/
      my repo      e4a               public/master   e4a                               e4a
       project                         project                           project
                   24f   ec5   c12   nick/master                                       4ea   df7   2fb
       "nick"                        "public"                           "jess"         a09




       git fetch nick
                                                     ce0   4a7   5ec   master

                                     my repo         e4a               public/master




                                 git fetch nick
                  git remote add jess git://github.com/jessica/project.git
ce0   4a7   5ec                                                 ce0   4a7   5ec
developer                                                   developer
             e4a                                                             e4a
  nick                                                       jessica
             24f   ec5   c12                                                 4ea   df7   2fb
                                                                             a09




             ce0   4a7   5ec              ce0   4a7   5ec                    ce0   4a7   5ec
 nickh/                        schacon/                      jessica/
             e4a                          e4a                                e4a
 project                        project                       project
             24f   ec5   c12                                                 4ea   df7   2fb
 "nick"                        "public"                       "jess"         a09




                                          ce0   4a7   5ec   master
                                                            master

                               my repo    e4a               public/master
                                                             public/master
                                          24f   ec5   c12   nick/master




                           git fetch nick
            git remote add jess git://github.com/jessica/project.git
                           git fetch nick
ce0   4a7   5ec                                                ce0   4a7   5ec
developer                                                  developer
            e4a                                                            e4a
  nick                                                      jessica
            24f   ec5   c12                                                4ea   df7   2fb
                                                                           a09




            ce0   4a7   5ec              ce0   4a7   5ec                   ce0   4a7   5ec
 nickh/                       schacon/                      jessica/
            e4a                          e4a                               e4a
 project                       project                       project
            24f   ec5   c12                                                4ea   df7   2fb
 "nick"                       "public"                       "jess"        a09




                                         ce0   4a7   5ec   master

                              my repo    e4a               public/master

                                         24f   ec5   c12   nick/master




                               git fetch nick
nickh/                      schacon/                            jessic
                                          e4a                                e4a
                                project                      project                             proje
                                          24f   ec5   c12
             ce0   4a7   5ec                                                 ce0   4a7   5ec
developer                       "nick"                      "public"
                                                            developer                            "jess
             e4a                                                             e4a
  nick                                                       jessica
             24f   ec5   c12                                                 4ea   df7   2fb
                                                                             a09




                                                                             ce0   4a7   5ec   master

             ce0   4a7   5ec              ce0   4a7   5ec   my repo          e4a
                                                                             ce0   4a7   5ec   public/
 nickh/                        schacon/                     jessica/
             e4a                          e4a                                24f
                                                                             e4a   ec5   c12   nick/ma
 project                        project                      project
             24f   ec5   c12                                                 4ea
                                                                             4ea   df7
                                                                                   df7   2fb
                                                                                         2fb   jess/ma

 "nick"                        "public"                       "jess"         a09
                                                                             a09




                                                              git fetch jess

                                          ce0   4a7   5ec   master
                                                             master

                               my repo    e4a               public/master
                                                             public/master

                                          24f   ec5   c12   nick/master




                           git fetchnick
                             git fetch jess
            git remote add jess git://github.com/jessica/project.git
ce0
             ce0   4a7
                   4a7   5ec
                         5ec                                                 ce0
                                                                             ce0   4a7
                                                                                   4a7   5ec
                                                                                         5ec
developer
developer                                                   developer
                                                            developer
             e4a
             e4a                                                             e4a
                                                                             e4a
  nick
   nick                                                      jessica
                                                             jessica
             24f
             24f   ec5
                   ec5   c12
                         c12                                                 4ea
                                                                             4ea   df7
                                                                                   df7   2fb
                                                                                         2fb
                                                                             a09
                                                                             a09




             ce0
             ce0   4a7
                   4a7   5ec
                         5ec              ce0
                                          ce0   4a7
                                                4a7   5ec
                                                      5ec                    ce0
                                                                             ce0   4a7
                                                                                   4a7   5ec
                                                                                         5ec
 nickh/
  nickh/                       schacon/
                               schacon/                      jessica/
                                                             jessica/
             e4a
             e4a                          e4a
                                          e4a                                e4a
                                                                             e4a
 project
 project                        project
                                project                       project
                                                              project
             24f
             24f   ec5
                   ec5   c12
                         c12                                                 4ea
                                                                             4ea   df7
                                                                                   df7   2fb
                                                                                         2fb
 "nick"                        "public"                       "jess"         a09
                                                                             a09




                                          ce0
                                          ce0   4a7
                                                4a7   5ec
                                                      5ec   master
                                                            master
                                                             master

                               my repo
                               my repo    e4a
                                          e4a               public/master
                                                            public/master
                                                             public/master

                                          24f
                                          24f   ec5
                                                ec5   c12
                                                      c12   nick/master
                                                            nick/master

                                          4ea   df7   2fb   jess/master

                                          a09




                           git fetchnick jess
            git remote add jess git://github.com/jessica/project.git
                             git fetch jess
ce0   4a7   5ec                                                ce0   4a7   5ec
developer                                                  developer
            e4a                                                            e4a
  nick                                                      jessica
            24f   ec5   c12                                                4ea   df7   2fb
                                                                           a09




            ce0   4a7   5ec              ce0   4a7   5ec                   ce0   4a7   5ec
 nickh/                       schacon/                      jessica/
            e4a                          e4a                               e4a
 project                       project                       project
            24f   ec5   c12                                                4ea   df7   2fb
 "nick"                       "public"                       "jess"        a09




                                         ce0   4a7   5ec   master

                              my repo    e4a               public/master

                                         24f   ec5   c12   nick/master

                                         4ea   df7   2fb   jess/master

                                         a09




                               git fetch jess
ce0   4a7   5ec                                                ce0   4a7   5ec
 developer                                                  developer
             e4a                                                            e4a
   nick                                                      jessica
             24f   ec5   c12                                                4ea   df7   2fb
                                                                            a09




             ce0   4a7   5ec              ce0   4a7   5ec                   ce0   4a7   5ec
  nickh/                       schacon/                      jessica/
             e4a                          e4a                               e4a
  project                       project                       project
             24f   ec5   c12                                                4ea   df7   2fb
  "nick"                       "public"                       "jess"        a09




                                          ce0   4a7   5ec
                               my repo    e4a               public/master

                                          24f   ec5   c12   nick/master

                                          4ea   df7   2fb   jess/master

                                          a09   c63   b3b   master




git merge nick jess
ce0   4a7   5ec                                                ce0   4a7   5ec
developer                                                  developer
            e4a                                                            e4a
  nick                                                      jessica
            24f   ec5   c12                                                4ea   df7   2fb
                                                                           a09




            ce0   4a7   5ec              ce0   4a7   5ec                   ce0   4a7   5ec
 nickh/                       schacon/                      jessica/
            e4a                          e4a                               e4a
 project                       project                       project
            24f   ec5   c12              24f   ec5   c12                   4ea   df7   2fb
 "nick"                       "public"   4ea   df7   2fb     "jess"        a09
                                         a09   c63   b3b




                                         ce0   4a7   5ec
                              my repo    e4a
                                         24f   ec5   c12   nick/master

                                         4ea   df7   2fb   jess/master

                                         a09   c63   b3b   master

                                                           public/master


git push public
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control
Intro to Git distributed version control

More Related Content

Viewers also liked

Gothic literature pp
Gothic literature ppGothic literature pp
Gothic literature pptrixiatan
 
Asai presentation
Asai presentationAsai presentation
Asai presentationThomas Roe
 
17th European Spas Association Congress
17th European Spas Association Congress17th European Spas Association Congress
17th European Spas Association CongressESPAMarketing
 
Contoh ngisi spt ppn 1111
Contoh ngisi spt ppn 1111Contoh ngisi spt ppn 1111
Contoh ngisi spt ppn 1111Tobagus Makmun
 
Cara Mudah Menggunakan Aplikasi eSPT PPh 21 2014
Cara Mudah Menggunakan Aplikasi eSPT PPh 21 2014Cara Mudah Menggunakan Aplikasi eSPT PPh 21 2014
Cara Mudah Menggunakan Aplikasi eSPT PPh 21 2014Tobagus Makmun
 
Petunjuk Praktis Kewajiban Perpajakan Bendahara BOS
Petunjuk Praktis Kewajiban Perpajakan Bendahara BOSPetunjuk Praktis Kewajiban Perpajakan Bendahara BOS
Petunjuk Praktis Kewajiban Perpajakan Bendahara BOSTobagus Makmun
 
Slide tutorial e filling spt 1770 ss
Slide tutorial e filling spt 1770 ssSlide tutorial e filling spt 1770 ss
Slide tutorial e filling spt 1770 ssTobagus Makmun
 
Slide tutorial registrasi e filing
Slide tutorial registrasi e filingSlide tutorial registrasi e filing
Slide tutorial registrasi e filingTobagus Makmun
 
ESPA Online Marketing
ESPA Online MarketingESPA Online Marketing
ESPA Online MarketingESPAMarketing
 
Sosialisasi Per 31/2012 - PPh pasal 21
Sosialisasi Per 31/2012 - PPh pasal 21Sosialisasi Per 31/2012 - PPh pasal 21
Sosialisasi Per 31/2012 - PPh pasal 21Tobagus Makmun
 

Viewers also liked (11)

Gothic literature pp
Gothic literature ppGothic literature pp
Gothic literature pp
 
Asai presentation
Asai presentationAsai presentation
Asai presentation
 
Introducing vista
Introducing vistaIntroducing vista
Introducing vista
 
17th European Spas Association Congress
17th European Spas Association Congress17th European Spas Association Congress
17th European Spas Association Congress
 
Contoh ngisi spt ppn 1111
Contoh ngisi spt ppn 1111Contoh ngisi spt ppn 1111
Contoh ngisi spt ppn 1111
 
Cara Mudah Menggunakan Aplikasi eSPT PPh 21 2014
Cara Mudah Menggunakan Aplikasi eSPT PPh 21 2014Cara Mudah Menggunakan Aplikasi eSPT PPh 21 2014
Cara Mudah Menggunakan Aplikasi eSPT PPh 21 2014
 
Petunjuk Praktis Kewajiban Perpajakan Bendahara BOS
Petunjuk Praktis Kewajiban Perpajakan Bendahara BOSPetunjuk Praktis Kewajiban Perpajakan Bendahara BOS
Petunjuk Praktis Kewajiban Perpajakan Bendahara BOS
 
Slide tutorial e filling spt 1770 ss
Slide tutorial e filling spt 1770 ssSlide tutorial e filling spt 1770 ss
Slide tutorial e filling spt 1770 ss
 
Slide tutorial registrasi e filing
Slide tutorial registrasi e filingSlide tutorial registrasi e filing
Slide tutorial registrasi e filing
 
ESPA Online Marketing
ESPA Online MarketingESPA Online Marketing
ESPA Online Marketing
 
Sosialisasi Per 31/2012 - PPh pasal 21
Sosialisasi Per 31/2012 - PPh pasal 21Sosialisasi Per 31/2012 - PPh pasal 21
Sosialisasi Per 31/2012 - PPh pasal 21
 

Recently uploaded

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
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
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
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
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
 
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
 
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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
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
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
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 AutomationSafe Software
 
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
 
#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
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 

Recently uploaded (20)

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
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
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
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
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...
 
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...
 
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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
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
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 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
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 

Intro to Git distributed version control

  • 1. Intro to Git Scott Chacon
  • 3. Git is an open source, distributed version control system designed for speed and efficiency
  • 4. Git is an open source, distributed version control system designed for speed and efficiency
  • 6. Git is an open source, distributed version control system designed for speed and efficiency
  • 11. which means everything is fast every clone is a backup
  • 12. which means everything is fast every clone is a backup work offline
  • 13. Git is an open source, distributed version control system designed for speed and efficiency
  • 14.
  • 18. C1 C2 C3 C4 C5 file A 1 2 delta storage file B 1 2 file C 1 2 3 C1 C2 C3 C4 C5 snapshot A A1 A1 A2 A2 storage B B B B1 B2 C C1 C2 C2 C3
  • 19. C1 C2 C3 C4 C5 file A 1 2 delta storage file B 1 2 file C 1 2 3 C1 C2 C3 C4 C5 snapshot A A1 A1 A2 A2 storage B B B B1 B2 C C1 C2 C2 C3
  • 20. C1 C2 C3 C4 C5 file A 1 2 delta storage file B 1 2 file C 1 2 3 C1 C2 C3 C4 C5 snapshot A A1 A1 A2 A2 storage B B B B1 B2 C C1 C2 C2 C3
  • 21. C1 C2 C3 C4 C5 file A 1 2 delta storage file B 1 2 file C 1 2 3 C1 C2 C3 C4 C5 snapshot A A1 A1 A2 A2 storage B B B B1 B2 C C1 C2 C2 C3
  • 22. C1 C2 C3 C4 C5 file A 1 2 delta storage file B 1 2 file C 1 2 3 C1 C2 C3 C4 C5 snapshot A A1 A1 A2 A2 storage B B B B1 B2 C C1 C2 C2 C3
  • 23. C1 C2 C3 C4 C5 file A 1 2 delta storage file B 1 2 file C 1 2 3 C1 C2 C3 C4 C5 snapshot A A1 A1 A2 A2 storage B B B B1 B2 C C1 C2 C2 C3
  • 24. C1 C2 C3 C4 C5 file A 1 2 delta storage file B 1 2 file C 1 2 3 C1 C2 C3 C4 C5 snapshot A A1 A1 A2 A2 storage B B B B1 B2 C C1 C2 C2 C3
  • 25. C1 C2 C3 C4 C5 file A 1 2 delta storage file B 1 2 file C 1 2 3 C1 C2 C3 C4 C5 snapshot A A1 A1 A2 A2 storage B B B B1 B2 C C1 C2 C2 C3
  • 26. C1 C2 C3 C4 C5 file A 1 2 delta storage file B 1 2 file C 1 2 3 C1 C2 C3 C4 C5 snapshot A A1 A1 A2 A2 storage B B B B1 B2 C C1 C2 C2 C3
  • 27. C1 C2 C3 C4 C5 file A 1 2 delta storage file B 1 2 file C 1 2 3 C1 C2 C3 C4 C5 snapshot A A1 A1 A2 A2 storage B B B B1 B2 C C1 C2 C2 C3
  • 28. C1 C2 C3 C4 C5 file A 1 2 delta storage file B 1 2 file C 1 2 3 C1 C2 C3 C4 C5 snapshot A A1 A1 A2 A2 storage B B B B1 B2 C C1 C2 C2 C3
  • 29. C1 C2 C3 C4 C5 file A 1 2 delta storage file B 1 2 file C 1 2 3 C1 C2 C3 C4 C5 snapshot A A1 A1 A2 A2 storage B B B B1 B2 C C1 C2 C2 C3
  • 30. C1 C2 C3 C4 C5 file A 1 2 delta storage file B 1 2 file C 1 2 3 C1 C2 C3 C4 C5 snapshot A A1 A1 A2 A2 storage B B B B1 B2 C C1 C2 C2 C3
  • 31. C1 C2 C3 C4 C5 file A 1 2 delta storage file B 1 2 file C 1 2 3 C1 C2 C3 C4 C5 snapshot A A1 A1 A2 A2 storage B B B B1 B2 C C1 C2 C2 C3
  • 32. C1 C2 C3 C4 C5 file A 1 2 delta storage file B 1 2 file C 1 2 3 C1 C2 C3 C4 C5 snapshot A A1 A1 A2 A2 storage B B B B1 B2 C C1 C2 C2 C3
  • 33. How is this Different Than {cvs|svn|p4}?
  • 36. No Network Needed Performing a diff
  • 37. No Network Needed Performing a diff Viewing file history
  • 38. No Network Needed Performing a diff Viewing file history Committing changes
  • 39. No Network Needed Performing a diff Viewing file history Committing changes Merging branches
  • 40. No Network Needed Performing a diff Viewing file history Committing changes Merging branches Obtaining any other revision of a file
  • 41. No Network Needed Performing a diff Viewing file history Committing changes Merging branches Obtaining any other revision of a file Switching branches
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 52. $ du -h testrepo/ 78M testrepo/ $ cd testrepo/ $ time git checkout -b newbranch Switched to a new branch "newbranch" real 0m0.091s user 0m0.016s sys 0m0.023s
  • 53. $ du -h testrepo/ 78M testrepo/ $ cd testrepo/ $ time git checkout -b newbranch Switched to a new branch "newbranch" real 0m0.091s user 0m0.016s sys 0m0.023s
  • 54. $ du -h testrepo/ 78M testrepo/ $ cd testrepo/ $ time git checkout -b newbranch Switched to a new branch "newbranch" real 0m0.091s user 0m0.016s sys 0m0.023s
  • 55. $ du -h testrepo/ 78M testrepo/ $ cd testrepo/ $ time git checkout -b newbranch Switched to a new branch "newbranch" real 0m0.091s user 0m0.016s sys 0m0.023s
  • 56. $ du -h testrepo/ 78M testrepo/ $ cd testrepo/ $ time git checkout -b newbranch Switched to a new branch "newbranch" real 0m0.091s user 0m0.016s sys 0m0.023s
  • 57. $ time cp -Rf testrepo r2 real 0m13.684s user 0m0.085s sys 0m1.215s
  • 59. How Do I Use Git?
  • 61. $ git config --global user.name “Scott Chacon” $ git config --global user.email “schacon@gmail.com”
  • 64. $ touch hello_world.rb $ git init $ git add . $ git commit -m ‘first commit’
  • 65. $ touch hello_world.rb $ git init $ git add . $ git commit -m ‘first commit’
  • 66. $ tree -a . |-- .git | |-- HEAD | |-- branches | |-- config | |-- description | |-- hooks | | |-- post-commit.sample | | |-- post-receive.sample | | |-- ... | | |-- pre-rebase.sample | | `-- update.sample | |-- info | | `-- exclude | |-- objects | | |-- info | | `-- pack | |-- refs | | |-- heads | | `-- tags | `-- remotes `-- hello_world.rb 11 directories, 25 files
  • 67. $ tree -a . |-- .git | |-- HEAD | |-- branches | |-- config | |-- description | |-- hooks | | |-- post-commit.sample | | |-- post-receive.sample | | |-- ... | | |-- pre-rebase.sample | | `-- update.sample | |-- info | | `-- exclude | |-- objects | | |-- info | | `-- pack | |-- refs | | |-- heads | | `-- tags | `-- remotes `-- hello_world.rb 11 directories, 25 files
  • 68. $ tree -a . |-- .git | |-- HEAD | |-- branches | |-- config | |-- description | |-- hooks | | |-- post-commit.sample | | |-- post-receive.sample | | |-- ... | | |-- pre-rebase.sample | | `-- update.sample | |-- info | | `-- exclude | |-- objects | | |-- info | | `-- pack | |-- refs | | |-- heads | | `-- tags | `-- remotes `-- hello_world.rb 11 directories, 25 files
  • 71. $ git clone git://github.com/schacon/grit.git
  • 72. $ git clone git://github.com/schacon/grit.git mygrit
  • 73. $ git clone git://github.com/schacon/grit.git mygrit Initialized empty Git repository in /home/schacon/mygrit/.git/ remote: Counting objects: 3220, done. remote: Compressing objects: 100% (2093/2093), done. remote: Total 3220 (delta 1134), reused 3149 (delta 1081) Receiving objects: 100% (3220/3220), 1.79 MiB | 357 KiB/s, done. Resolving deltas: 100% (1134/1134), done.
  • 74. $ git clone git://github.com/schacon/grit.git mygrit Initialized empty Git repository in /home/schacon/mygrit/.git/ remote: Counting objects: 3220, done. remote: Compressing objects: 100% (2093/2093), done. remote: Total 3220 (delta 1134), reused 3149 (delta 1081) Receiving objects: 100% (3220/3220), 1.79 MiB | 357 KiB/s, done. Resolving deltas: 100% (1134/1134), done. $ cd mygrit $
  • 75. $ git clone git://github.com/schacon/grit.git mygrit Initialized empty Git repository in /home/schacon/mygrit/.git/ remote: Counting objects: 3220, done. remote: Compressing objects: 100% (2093/2093), done. remote: Total 3220 (delta 1134), reused 3149 (delta 1081) Receiving objects: 100% (3220/3220), 1.79 MiB | 357 KiB/s, done. Resolving deltas: 100% (1134/1134), done. $ cd mygrit $ ls API.txt Manifest.txt README.txt benchmarks.rb examples lib History.txt PURE_TODO Rakefile benchmarks.txt grit.gemspec test $
  • 78. $ tree -a . |-- .git | |-- HEAD | |-- branches | |-- config | |-- description | |-- hooks | | |-- post-commit.sample | | |-- post-receive.sample | | |-- ... | | |-- pre-rebase.sample | | `-- update.sample | |-- info | | `-- exclude | |-- objects | | |-- info | | `-- pack | |-- refs | | |-- heads | | `-- tags | `-- remotes `-- hello_world.rb 11 directories, 25 files
  • 79. $ tree -a . |-- .git | |-- HEAD | |-- branches | |-- config | |-- description | |-- hooks | | |-- post-commit.sample | | |-- post-receive.sample | | |-- ... | | |-- pre-rebase.sample | | `-- update.sample | |-- info | | `-- exclude | |-- objects | | |-- info | | `-- pack | |-- refs | | |-- heads | | `-- tags | `-- remotes `-- hello_world.rb 11 directories, 25 files
  • 81. $ tree -a . |-- .git | |-- HEAD | |-- branches | |-- config | |-- description | |-- hooks | | |-- post-commit.sample | | |-- post-receive.sample | | |-- ... | | |-- pre-rebase.sample | | `-- update.sample | |-- info | | `-- exclude | |-- objects | | |-- info | | `-- pack | |-- refs | | |-- heads | | `-- tags | `-- remotes `-- hello_world.rb 11 directories, 25 files
  • 85. $ tree -a . |-- .git | |-- HEAD | |-- branches | |-- config | |-- description | |-- hooks | | |-- post-commit.sample | | |-- post-receive.sample | | |-- ... | | |-- pre-rebase.sample | | `-- update.sample | |-- info | | `-- exclude | |-- objects | | |-- info | | `-- pack | |-- refs | | |-- heads | | `-- tags | `-- remotes `-- hello_world.rb 11 directories, 25 files
  • 86. $ tree -a . |-- .git | |-- HEAD | |-- branches | |-- config | |-- description | |-- hooks | | |-- post-commit.sample | | |-- post-receive.sample | | |-- ... | | |-- pre-rebase.sample | | `-- update.sample | |-- info | | `-- exclude | |-- objects | | |-- info | | `-- pack | |-- refs | | |-- heads | | `-- tags | `-- remotes `-- hello_world.rb 11 directories, 25 files
  • 87. $ tree -a . |-- .git | |-- HEAD | |-- branches | |-- config | |-- description | |-- hooks | | |-- post-commit.sample | | |-- post-receive.sample | | |-- ... | | |-- pre-rebase.sample | | `-- update.sample | |-- info | | `-- exclude | |-- objects | | |-- info | | `-- pack | |-- refs | | |-- heads | | `-- tags | `-- remotes `-- hello_world.rb 11 directories, 25 files
  • 88. $ touch hello_world.rb $ git init $ git add . $ git commit -m ‘first commit’
  • 89. $ touch hello_world.rb $ git init $ git add . $ git commit -m ‘first commit’
  • 90. $ tree -a . |-- .git | |-- COMMIT_EDITMSG | |-- HEAD | |-- branches | |-- config | |-- description | |-- hooks | | |-- applypatch-msg.sample | | `-- update.sample | |-- index | |-- info | | `-- exclude | |-- logs | | |-- HEAD | | `-- refs | | `-- heads | | `-- master | |-- objects | | |-- 32/09658ac8d80bc9726d3a33d77e3dfc5fe6035e | | |-- 53/9cd7886a627841d525a78d45cbc6396be20b41 | | |-- e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 | | |-- info | | `-- pack | |-- refs | | |-- heads | | | `-- master | | `-- tags | `-- remotes `-- hello_world.rb 17 directories, 33 files
  • 91. $ tree -a . |-- .git | |-- COMMIT_EDITMSG | |-- HEAD | |-- branches | |-- config | |-- description | |-- hooks | | |-- applypatch-msg.sample | | `-- update.sample | |-- index | |-- info | | `-- exclude | |-- logs | | |-- HEAD | | `-- refs | | `-- heads | | `-- master | |-- objects | | |-- 32/09658ac8d80bc9726d3a33d77e3dfc5fe6035e | | |-- 53/9cd7886a627841d525a78d45cbc6396be20b41 | | |-- e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 | | |-- info | | `-- pack | |-- refs | | |-- heads | | | `-- master | | `-- tags | `-- remotes `-- hello_world.rb 17 directories, 33 files
  • 92. $ tree -a . |-- .git | |-- COMMIT_EDITMSG | |-- HEAD | |-- branches | |-- config | |-- description | |-- hooks | | |-- applypatch-msg.sample | | `-- update.sample | |-- index | |-- info | | `-- exclude | |-- logs | | |-- HEAD | | `-- refs | | `-- heads | | `-- master | |-- objects | | |-- 32/09658ac8d80bc9726d3a33d77e3dfc5fe6035e | | |-- 53/9cd7886a627841d525a78d45cbc6396be20b41 | | |-- e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 | | |-- info | | `-- pack | |-- refs | | |-- heads | | | `-- master | | `-- tags | `-- remotes `-- hello_world.rb 17 directories, 33 files
  • 94. A Basic Workflow Edit files Stage the changes Review your changes Commit the changes
  • 95. working directory git add index git commit repository
  • 96. a working copy working directory of your project git add index git commit repository
  • 97. working directory git add index git commit object database repository
  • 98. working directory git add index “staging” git commit repository
  • 99. A Basic Workflow Edit files Stage the changes Review your changes Commit the changes
  • 103. $ vim main.py #!/usr/bin/env python import wsgiref.handlers from google.appengine.ext import webapp class MainHandler(webapp.RequestHandler): def get(self): self.response.out.write('Hello world!') def main(): application = webapp.WSGIApplication([('/', MainHandler)], debug=True) wsgiref.handlers.CGIHandler().run(application) if __name__ == '__main__': main() ~ ~ "main.py" 16L, 402C
  • 104. $ vim main.py #!/usr/bin/env python import wsgiref.handlers from google.appengine.ext import webapp class MainHandler(webapp.RequestHandler): def get(self): self.response.out.write('Hello world!') def main(): application = webapp.WSGIApplication([('/', MainHandler)], debug=True) wsgiref.handlers.CGIHandler().run(application) if __name__ == '__main__': main() ~ ~ "main.py" 16L, 402C
  • 105. $ vim main.py #!/usr/bin/env python import wsgiref.handlers from google.appengine.ext import webapp class MainHandler(webapp.RequestHandler): def get(self): self.response.out.write('Hello world!') def main(): application = webapp.WSGIApplication([('/', MainHandler)], debug=True) wsgiref.handlers.CGIHandler().run(application) if __name__ == '__main__': main() ~ ~ "main.py" 16L, 402C
  • 106. $ vim main.py #!/usr/bin/env python import wsgiref.handlers from google.appengine.ext import webapp # this program prints out ‘hello world’ class MainHandler(webapp.RequestHandler): def get(self): self.response.out.write('Hello world!') def main(): application = webapp.WSGIApplication([('/', MainHandler)], debug=True) wsgiref.handlers.CGIHandler().run(application) if __name__ == '__main__': main() ~ ~ "main.py" 16L, 402C
  • 108. $ git status # On branch master # Changed but not updated: # (use "git add <file>..." to update what # # modified: main.py # no changes added to commit (use "git add" an
  • 109. $ git status # On branch master # Changed but not updated: # (use "git add <file>..." to update what # # modified: main.py # no changes added to commit (use "git add" an
  • 110. $ git status # On branch master # Changed but not updated: # (use "git add <file>..." to update what # # modified: main.py # no changes added to commit (use "git add" an
  • 111. $ git status # On branch master # Changed but not updated: # (use "git add <file>..." to update what # # modified: main.py # no changes added to commit (use "git add" an
  • 112. $ git status # On branch master # Changed but not updated: # (use "git add <file>..." to update what # # modified: main.py # no changes added to commit (use "git add" an
  • 113. $ git status # On branch master # Changed but not updated: # (use "git add <file>..." to update what # # modified: main.py # no changes added to commit (use "git add" an
  • 114. $ git status # On branch master # Changed but not STAGED updated: # (use "git add <file>..." to update what # # modified: main.py # no changes added to commit (use "git add" an
  • 115. $ git status # On branch master # Changed but not STAGED updated: # (use "git add <file>..." to update what # # modified: main.py # no changes added to commit (use "git add" an
  • 116. A Basic Workflow Edit files Stage the changes Review your changes Commit the changes
  • 118. working directory git add index git commit repository
  • 119. working directory git add index git commit repository
  • 120. $ git add main.py $ git status # On branch master # Changes to be committed: # (use "git reset HEAD <file>. # # modified: main.py #
  • 121. $ git add main.py $ git status # On branch master # Changes to be committed: # (use "git reset HEAD <file>. # # modified: main.py #
  • 122. $ git add main.py $ git status # On branch master # Changes to be committed: # (use "git reset HEAD <file>. # # modified: main.py #
  • 123. $ git add main.py $ git status # On branch master # Changes to be committed: # (use "git reset HEAD <file>. # # modified: main.py #
  • 124. $ git add main.py $ git status # On branch master # Changes to be committed: THAT ARE STAGED # (use "git reset HEAD <file>. # # modified: main.py #
  • 125. $ vim app.yaml application: chacon version: 1 runtime: python api_version: 1 handlers: - url: .* script: main.py ~ ~ ~ "app.yaml" 8L, 101C
  • 126. $ vim app.yaml application: chacon version: 1 runtime: python api_version: 1 handlers: - url: .* script: main.py ~ ~ ~ "app.yaml" 8L, 101C
  • 127. $ vim app.yaml application: chacon version: 1 runtime: python api_version: 1 handlers: - url: .* script: main.py ~ ~ ~ "app.yaml" 8L, 101C
  • 128. $ vim app.yaml application: chacon version: 1 runtime: python api_version: 1 handlers: - url: .* script: main.py ~ ~ ~ "app.yaml" 8L, 101C
  • 129. $ vim app.yaml application: chacon version: 2 runtime: python api_version: 1 handlers: - url: .* script: main.py ~ ~ ~ "app.yaml" 8L, 101C
  • 130. $ git status # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # modified: main.py # # Changed but not updated: # (use "git add <file>..." to update what will be com # # modified: app.yaml #
  • 131. $ git status # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # modified: main.py # # Changed but not updated: # (use "git add <file>..." to update what will be com # # modified: app.yaml #
  • 132. $ git status # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # modified: main.py # # Changed but not updated: # (use "git add <file>..." to update what will be com # # modified: app.yaml #
  • 133. $ vim main.py #!/usr/bin/env python import wsgiref.handlers from google.appengine.ext import webapp # this program prints out ‘hello world’ class MainHandler(webapp.RequestHandler): def get(self): self.response.out.write('Hello world!') def main(): application = webapp.WSGIApplication([('/', MainHandler)], debug=True) wsgiref.handlers.CGIHandler().run(application) if __name__ == '__main__': main() ~ ~ "main.py" 16L, 402C
  • 134. $ vim main.py #!/usr/bin/env python import wsgiref.handlers from google.appengine.ext import webapp # this program prints out ‘hello world’ class MainHandler(webapp.RequestHandler): def get(self): self.response.out.write('Hello world!') def main(): application = webapp.WSGIApplication([('/', MainHandler)], debug=True) wsgiref.handlers.CGIHandler().run(application) if __name__ == '__main__': main() ~ ~ "main.py" 16L, 402C
  • 135. $ vim main.py #!/usr/bin/env python import wsgiref.handlers from google.appengine.ext import webapp # this program prints out ‘hello world’ class MainHandler(webapp.RequestHandler): def get(self): self.response.out.write('Hello world!') def main(): application = webapp.WSGIApplication([('/', MainHandler)], debug=True) wsgiref.handlers.CGIHandler().run(application) if __name__ == '__main__': main() ~ ~ "main.py" 16L, 402C
  • 136. $ vim main.py #!/usr/bin/env python import wsgiref.handlers from google.appengine.ext import webapp # this program prints out ‘hello world’ class MainHandler(webapp.RequestHandler): def get(self): self.response.out.write('Hola world!') def main(): application = webapp.WSGIApplication([('/', MainHandler)], debug=True) wsgiref.handlers.CGIHandler().run(application) if __name__ == '__main__': main() ~ ~ "main.py" 16L, 402C
  • 137. $ vim main.py #!/usr/bin/env python import wsgiref.handlers from google.appengine.ext import webapp # this program prints out ‘hello world’ class MainHandler(webapp.RequestHandler): def get(self): self.response.out.write('Hola Mundo!') def main(): application = webapp.WSGIApplication([('/', MainHandler)], debug=True) wsgiref.handlers.CGIHandler().run(application) if __name__ == '__main__': main() ~ ~ "main.py" 16L, 402C
  • 138. $ git status # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # modified: main.py # # Changed but not updated: # (use "git add <file>..." to update what will be com # # modified: app.yaml # modified: main.py #
  • 139. $ git status # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # modified: main.py # # Changed but not updated: # (use "git add <file>..." to update what will be com # # modified: app.yaml # modified: main.py #
  • 140. $ git status # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # modified: main.py # # Changed but not updated: # (use "git add <file>..." to update what will be com # # modified: app.yaml # modified: main.py #
  • 141. $ git status # On branch master # Changes to be committed: Staged # (use "git reset HEAD <file>..." to unstage) # # modified: main.py # # Changed but not updated: # (use "git add <file>..." to update what will be com # # modified: app.yaml # modified: main.py #
  • 142. $ git status # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # modified: main.py # # Changed but not updated: Unstaged # # (use "git add <file>..." to update what will be com # modified: app.yaml # modified: main.py #
  • 143. $ git status # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # modified: main.py # # Changed but not updated: # (use "git add <file>..." to update what will be com # # modified: app.yaml # modified: main.py #
  • 144. Staged In Working Directory #!/usr/bin/env python #!/usr/bin/env python import wsgiref.handlers import wsgiref.handlers from google.appengine.ext import webapp from google.appengine.ext import webapp # this program prints out ‘hello world’ # this program prints out ‘hello world’ class MainHandler(webapp.RequestHandler): class MainHandler(webapp.RequestHandler): def get(self): def get(self): self.response.out.write('Hello World!') self.response.out.write('Hola Mundo!') def main(): def main(): application = application = webapp.WSGIApplication([('/' webapp.WSGIApplication([('/' debug=True) debug=True) wsgiref.handlers.CGIHandler().run(applicat wsgiref.handlers.CGIHandler().run(applicat if __name__ == '__main__': if __name__ == '__main__': main() main()
  • 145. Staged In Working Directory #!/usr/bin/env python #!/usr/bin/env python import wsgiref.handlers import wsgiref.handlers from google.appengine.ext import webapp from google.appengine.ext import webapp # this program prints out ‘hello world’ # this program prints out ‘hello world’ class MainHandler(webapp.RequestHandler): class MainHandler(webapp.RequestHandler): def get(self): def get(self): self.response.out.write('Hello World!') self.response.out.write('Hola Mundo!') def main(): def main(): application = application = webapp.WSGIApplication([('/' webapp.WSGIApplication([('/' debug=True) debug=True) wsgiref.handlers.CGIHandler().run(applicat wsgiref.handlers.CGIHandler().run(applicat if __name__ == '__main__': if __name__ == '__main__': main() main()
  • 146. You have to stage a file after you edit it
  • 147. You have to stage a file after you edit it
  • 148. You have to stage a file after you edit it
  • 149. $ git add app.yaml main.py $ git status # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # modified: app.yaml # modified: main.py #
  • 150. $ git add app.yaml main.py $ git status # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # modified: app.yaml # modified: main.py #
  • 151. $ git add app.yaml main.py $ git status # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # modified: app.yaml # modified: main.py #
  • 152. A Basic Workflow Edit files Stage the changes Review your changes Commit the changes
  • 154. working directory git add index git commit repository
  • 155. working directory git add index git commit repository
  • 156. $ git commit # Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # modified: app.yaml # modified: main.py # ~ ~ ~ ~ ".git/COMMIT_EDITMSG" 10L, 279C
  • 157. $ git commit # Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # modified: app.yaml # modified: main.py # ~ ~ ~ ~ ".git/COMMIT_EDITMSG" 10L, 279C
  • 158. $ git commit # Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # modified: app.yaml # modified: main.py # ~ ~ ~ ~ ".git/COMMIT_EDITMSG" 10L, 279C
  • 159. $ git commit descriptive commit message # Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # modified: app.yaml # modified: main.py # ~ ~ ~ ~ ".git/COMMIT_EDITMSG" 10L, 279C
  • 160. $ git commit descriptive commit message # Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # modified: app.yaml # modified: main.py # ~ ~ ~ ~ ".git/COMMIT_EDITMSG" 10L, 279C
  • 161. $ git commit Created commit 77d3001: descriptive commit message 2 files changed, 4 insertions(+), 2 deletions(-)
  • 162. A Basic Workflow Edit files vim / emacs / etc Stage the changes git add (file) Review your changes repo status Commit the changes git commit
  • 163. A Basic Workflow Edit files vim / emacs / etc Stage the changes git add (file) Review your changes repo status Commit the changes git commit
  • 164. A Basic Workflow Edit files vim / emacs / etc Stage the changes git add (file) Review your changes repo status Commit the changes git commit
  • 165. A Basic Workflow Edit files vim / emacs / etc Stage the changes git add (file) Review your changes git status Commit the changes git commit
  • 166. A Basic Workflow Edit files vim / emacs / etc Stage the changes git add (file) Review your changes git status Commit the changes git commit
  • 168. A Basicerer Workflow Edit files vim / emacs / etc Commit the changes git commit
  • 169. A Basicerer Workflow Edit files vim / emacs / etc Stage & commit the changes git commit -a
  • 170. A Basicerer Workflow Edit files vim / emacs / etc Stage & commit the changes git commit -a
  • 172. $ git commit Created commit 77d3001: descriptive commit message 2 files changed, 4 insertions(+), 2 deletions(-)
  • 173. $ git commit Created commit 77d3001: descriptive commit message 2 files changed, 4 insertions(+), 2 deletions(-)
  • 179. 77d3001a1de6bf8f5e431972fe4d25b01e595c0b ae668.. commit size tree c4ec5 parent a149e author Scott committer Scott my commit message goes here and it is really, really cool
  • 180. 77d3001a1de6bf8f5e431972fe4d25b01e595c0b ae668.. commit size tree c4ec543b0322744e55c5efc9b6c4e449d398dbff parent a149e2160b3f7573768cdc2fce24d0881f3577e1 tree c4ec5 author Scott Chacon <schacon@gmail.com> 1223402504 -0700 committer Scott Chaconparent <schacon@gmail.com> 1223402504 -0700 a149e author Scott descriptive commit message committer Scott my commit message goes here and it is really, really cool
  • 181. 77d3001a1de6bf8f5e431972fe4d25b01e595c0b ae668.. commit size tree c4ec5 parent a149e author Scott committer Scott my commit message goes here and it is really, really cool
  • 182. 77d3001a1de6bf8f5e431972fe4d25b01e595c0b ae668.. commit size tree c4ec5 parent a149e author Scott committer Scott my commit message goes here and it is really, really cool ./ c4e app.yaml 3d5 index.yaml 1d3 main.py 03e
  • 183. ae668.. commit size commit size tree 2de54 tree c4ec5 parent 38def parent a149e author Scott author Scott committer Scott this is the previous commit committer Scott and I am very proud of it my commit message goes here and it is really, really cool ./ c4e app.yaml 3d5 index.yaml 1d3 main.py 03e
  • 184. ae668.. commit size commit size tree 2de54 tree c4ec5 parent 38def parent a149e author Scott author Scott committer Scott this is the previous commit committer Scott and I am very proud of it my commit message goes here and it is really, really cool ./ c4e app.yaml 3d5 index.yaml 1d3 ./ c4e main.py 03e app.yaml 3d5 index.yaml 1d3 main.py 03e
  • 185. ae668.. commit size commit size commit size commit size tree 2de54 tree c4ec5 tree 2fe65 tree parent author 2fe65 90ecd parent 90ecd parent 38def parent a149e Scott author Scott author author committer Scott committer Scott this is the commit before that and I'm not sure why Scott Scott this is the commit before that and I'm not sure why committer Scott this is the previous commit committer Scott and I am very proud of it ./ c4e app.yaml 3d5 my commit message goes here ./ c4e index.yaml 1d3 and it is really, really cool app.yaml 3d5 main.py 03e index.yaml 1d3 ./ c4e main.py 03e app.yaml 3d5 index.yaml 1d3 ./ c4e main.py 03e app.yaml 3d5 index.yaml 1d3 main.py 03e
  • 186. ae668.. commit size commit size commit size commit size tree 2de54 tree c4ec5 tree 2fe65 tree parent author 48e 2fe65 90ecd parent 38d 90ecd parent a14 38def parent 77d a149e Scott author Scott author author committer Scott committer Scott this is the commit before that and I'm not sure why Scott Scott this is the commit before that and I'm not sure why committer Scott this is the previous commit committer Scott and I am very proud of it ./ c4e 3d5 my commit message goes here 32a app.yaml c4e ./ index.yaml 1d3 and it is really, really cool app.yaml 3d5 main.py 03e index.yaml 5b1 1d3 c4e ./ f46 main.py 03e app.yaml 23f 3d5 index.yaml 30e 1d3 ./ c4e main.py 67e 03e app.yaml 3d5 index.yaml 1d3 main.py 03e 03e
  • 187. 48e 32a ae668.. f46 23f 30e commit size 67e commit size commit size tree tree c4ec5 c4e commit size tree 2fe65 2de54 tree parent author 2fe65 90ecd parent 90ecd parent 38def parent a149e Scott author Scott author author committer Scott committer Scott this is the commit before that and I'm not sure why Scott Scott this is the commit before that and I'm not sure why committer Scott 3d5 1d3 this is the previous commit committer Scott and I am very proud of it ./ c4e app.yaml 3d5 my commit message goes here ./ c4e index.yaml 1d3 and it is really, really cool app.yaml 3d5 a14 main.py 03e 03e index.yaml 1d3 ./ c4e main.py 03e app.yaml 3d5 38d 5b1 index.yaml 1d3 ./ c4e 77d main.py 03e app.yaml 3d5 index.yaml 1d3 main.py 03e
  • 188. Repository 5b1 32a c36 1d3 f46 3d4 ffe 6fe ae6 38d 23f 03e 254 30e 5b1 a14 67e 1d3 3d5 735 d23 c4e c4e 48e 77d de3 2d3
  • 189. Repository 5b1 32a c36 1d3 f46 3d4 ffe 6fe ae6 git checkout ae635 38d 23f 03e 254 30e 5b1 a14 67e 1d3 3d5 735 d23 c4e c4e 48e 77d de3 2d3
  • 190. Repository 5b1 32a c36 1d3 f46 3d4 ffe 6fe ae6 git checkout ae635 38d 23f 03e 254 30e 5b1 a14 67e 1d3 3d5 735 d23 c4e c4e 48e 77d de3 2d3
  • 191. Repository Index Working Directory 5b1 32a c36 ./ 3d4 ./ 1d3 f46 3d4 ffe 6fe ae6 ./Rakefile 1d3 Rakefile 38d 23f 03e ./README 03e README 254 30e 5b1 a14 67e 1d3 ./lib/ c36 lib/ 3d5 735 d23 c4e c4e 48e ./lib/simplegit.rb 5b1 simplegit.rb 77d de3 2d3
  • 192. Repository Index Working Directory 5b1 32a c36 ./ 3d4 ./ 1d3 f46 3d4 ffe 6fe ae6 ./Rakefile 1d3 Rakefile 38d 23f 03e ./README 03e README 254 30e 5b1 a14 67e 1d3 ./lib/ c36 lib/ 3d5 735 d23 c4e c4e 48e ./lib/simplegit.rb 5b1 simplegit.rb 77d de3 2d3
  • 193. Repository Index Working Directory 5b1 32a c36 ./ 3d4 ./ 1d3 f46 3d4 ffe 6fe ae6 ./Rakefile 1d3 Rakefile 38d 23f 03e ./README 03e README 254 30e 5b1 a14 67e 1d3 ./lib/ c36 lib/ 3d5 735 d23 c4e c4e 48e ./lib/simplegit.rb 5b1 simplegit.rb 77d de3 2d3
  • 194. Repository Index Working Directory 5b1 32a c36 ./ 3d4 ./ 1d3 f46 3d4 ffe 6fe ae6 ./Rakefile 1d3 Rakefile 38d 23f 03e ./README 03e README 254 30e 5b1 a14 67e 1d3 ./lib/ c36 lib/ 3d5 735 d23 c4e c4e 48e ./lib/simplegit.rb 5b1 simplegit.rb 77d de3 2d3
  • 195. Repository Index Working Directory 5b1 32a c36 ./ 3d4 ./ 1d3 f46 3d4 ffe 6fe ae6 ./Rakefile 1d3 Rakefile 38d 23f 03e ./README 03e README 254 30e 5b1 a14 67e 1d3 ./lib/ c36 lib/ 3d5 735 d23 c4e c4e 48e ./lib/simplegit.rb 5b1 simplegit.rb 77d de3 2d3 git add
  • 196. Repository Index Working Directory 5b1 32a c36 ./ 3d4 ./ 1d3 f46 3d4 ffe 6fe ae6 ./Rakefile 1d3 Rakefile 34f 38d 23f 03e ./README 03e README 254 30e 5b1 a14 67e 1d3 ./lib/ c36 lib/ 3d5 735 d23 c4e c4e 48e ./lib/simplegit.rb 5b1 simplegit.rb 77d de3 2d3 git add
  • 197. Repository Index Working Directory 5b1 32a c36 ./ 3d4 ./ 1d3 f46 3d4 ffe 6fe ae6 ./Rakefile 1d3 34f Rakefile 38d 23f 03e ./README 03e README 254 30e 5b1 a14 67e 1d3 ./lib/ c36 lib/ 3d5 735 d23 c4e c4e 48e ./lib/simplegit.rb 5b1 simplegit.rb 77d de3 2d3 34f 3da a08 ae9 git commit
  • 198. Repository Index Working Directory 5b1 32a c36 ./ 3d4 ./ 1d3 f46 3d4 ffe 6fe ae6 ./Rakefile 1d3 34f Rakefile 38d 23f 03e ./README 03e README 254 30e 5b1 a14 67e 1d3 ./lib/ c36 lib/ 3d5 735 d23 c4e c4e 48e ./lib/simplegit.rb 5b1 simplegit.rb 77d de3 2d3 34f 3da a08 ae9
  • 199. Repository Index Working Directory 5b1 32a c36 ./ 3d4 ./ 1d3 f46 3d4 ffe 6fe ae6 ./Rakefile 1d3 34f Rakefile 38d 23f 03e ./README 03e README 254 30e 5b1 a14 67e 1d3 ./lib/ c36 lib/ 3d5 735 d23 c4e c4e 48e ./lib/simplegit.rb 5b1 simplegit.rb 77d de3 2d3 34f 3da a08 ae9
  • 200. object model commit tree blob } C1
  • 201. object model pointer to a commit } snapshot C1 directory list tree file contents blob
  • 202. object model pointer to a commit } snapshot C1 directory list tree file contents blob
  • 209. HEAD default master experiment C0 C1 C2 C3
  • 210. HEAD C4 default master experiment C3 C0 C5 C1 C2 experiment C3 git branch experiment
  • 211. HEAD C4 default master experiment C3 C0 C5 C1 C2 experiment C3 git branch experiment
  • 212. HEAD C4 default master experiment $ git branch C3 C0 C5 C1 * default experiment C2 experiment C3
  • 213. HEAD C4 default master experiment $ git branch C3 C0 C5 C1 * default experiment C2 experiment C3
  • 214. C4 default master experiment C3 C0 C5 C1 C2 experiment C3 HEAD git checkout experiment
  • 215. T1 master default master experiment git commit C0 C4 C1 2 C3 C5 C2 C3 experiment HEAD
  • 216. T1 master default master experiment git commit C0 C4 C1 2 C3 C5 C2 C3 experiment HEAD
  • 217. T1 master default master experiment git commit C0 C4 C1 2 C3 C5 C2 C3 experiment HEAD
  • 218. T1 master default master experiment git commit C1 C0 C1 C4 git commit C2 C3 C2 C5 C3 experiment HEAD
  • 219. HEAD T1 default master git checkout default master experiment C1 C0 C1 C4 C2 C3 C2 C5 C3 experiment
  • 220. HEAD T1 default master git checkout default master experiment C1 C0 C1 C4 C2 C3 C2 C5 C3 experiment
  • 221. git commit T1 T1 master default master HEAD C1 C0 C1 C4 C4 C2 C3 C2 C5 C3 C5 experiment experiment
  • 222. git commit T1 T1 master default master HEAD C1 C0 C1 C4 C4 C2 C3 C2 C5 C3 C5 experiment experiment
  • 223. git commit T1 T1 master default master HEAD C1 C0 C1 C4 C4 C2 C3 C2 C5 C3 C5 experiment experiment
  • 224. T1 default master C0 C1 C4 C2 C3 C5 git checkout experiment experiment git commit HEAD
  • 227. T1 default master C0 C1 C4 C2 C3 C5 experiment HEAD
  • 228. HEAD T1 default master C0 C1 C4 C2 C3 C5 git checkout default experiment
  • 229. HEAD T1 master default C0 C1 C4 C6 C2 C3 C5 git checkout default experiment git merge experiment
  • 230. HEAD T1 master default C0 C1 C4 C6 C2 C3 C5 git checkout default experiment git merge experiment
  • 231. default C0 C1 C4 C6 C8 C2 C3 C5 C7 experiment git checkout experiment HEAD
  • 232. default C0 C1 C4 C6 C8 C2 C3 C5 C7 experiment git commit HEAD
  • 233. HEAD default C0 C1 C4 C6 C8 C2 C3 C5 C7 experiment git checkout default
  • 234. HEAD default C0 C1 C4 C6 C8 C2 C3 C5 C7 experiment git merge experiment
  • 235. Hot 3 Way Merge Action
  • 236. master C0 C1 C4 C2 C3 C5 experiment
  • 237. master C0 C1 C4 C2 C3 C5 experiment
  • 238. C0 C1 C4 C6 C2 C3 C5 C7
  • 239. C0 C1 C4 C6 C2 C3 C5 C7
  • 240. C0 C1 C4 C6 C2 C3 C5 C7
  • 243. local repo public repo public repo internet local repo A B C
  • 244. local repo public repo public repo A B C internet git push (ssh) local repo A B C
  • 245. local repo git fetch A B C (git) public repo public repo A B C internet git push (ssh) local repo A B C
  • 246. local repo git fetch A B C (git) D E F git commit public repo public repo A B C internet git push (ssh) local repo A B C
  • 247. local repo git fetch A B C git push (git) D E F (ssh) public repo public repo A B C A B C internet D E F git push (ssh) local repo A B C
  • 248. local repo git fetch A B C git push (git) D E F (ssh) public repo public repo A B C A B C internet D E F git push git fetch (ssh) (http) local repo A B C D E F
  • 249. local repo git fetch A B C git push (git) D E F (ssh) public repo public repo A B C A B C internet D E F D E F git push git fetch (ssh) (http) local repo A B C D E F
  • 251. developer developer nick jessica ce0 4a7 5ec master my repo e4a
  • 252. developer developer nick jessica commit ce0 4a7 5ec master my repo e4a
  • 253. developer developer nick jessica tree ce0 4a7 5ec master my repo e4a
  • 254. developer developer nick jessica blobs ce0 4a7 5ec master my repo e4a
  • 255. developer developer nick jessica ce0 4a7 5ec schacon/ e4a project "public" git push public ce0 4a7 5ec master my repo e4a public/master
  • 256. ce0 4a7 5ec developer developer e4a nick jessica git clone (url) ce0 4a7 5ec schacon/ e4a project "public" ce0 4a7 5ec master my repo e4a public/master
  • 257. ce0 4a7 5ec developer developer e4a nick jessica 24f ec5 c12 git commit ce0 4a7 5ec schacon/ e4a project "public" ce0 4a7 5ec master my repo e4a public/master
  • 258. ce0 4a7 5ec ce0 4a7 5ec developer developer e4a e4a nick 24f ec5 c12 git clone (url) jessica ce0 4a7 5ec schacon/ e4a project "public" ce0 4a7 5ec master my repo e4a public/master
  • 259. ce0 4a7 5ec ce0 4a7 5ec developer developer e4a e4a nick jessica 24f ec5 c12 4ea df7 2fb git commit a09 ce0 4a7 5ec schacon/ e4a project "public" ce0 4a7 5ec master my repo e4a public/master
  • 260. ce0 4a7 5ec ce0 4a7 5ec developer developer e4a e4a nick jessica 24f ec5 c12 4ea df7 2fb git push a09 ce0 4a7 5ec ce0 4a7 5ec ce0 4a7 5ec nickh/ schacon/ jessica/ e4a e4a e4a project project project 24f ec5 c12 4ea df7 2fb "public" a09 ce0 4a7 5ec master my repo e4a public/master
  • 261. ce0 4a7 5ec ce0 4a7 5ec developer developer e4a e4a nick jessica 24f ec5 c12 4ea df7 2fb a09 ce0 4a7 5ec ce0 4a7 5ec ce0 4a7 5ec nickh/ schacon/ jessica/ e4a e4a e4a project project project 24f ec5 c12 4ea df7 2fb "nick" "public" a09 ce0 4a7 5ec master my repo e4a public/master git remote add nicknick git://github.com/nickh/project.git git remote add git://github.com/nickh/project.git
  • 262. ce0 4a7 5ec ce0 4a7 5ec developer developer e4a e4a nick jessica 24f ec5 c12 4ea df7 2fb a09 ce0 4a7 5ec ce0 4a7 5ec ce0 4a7 5ec nickh/ schacon/ jessica/ e4a e4a e4a project project project 24f ec5 c12 4ea df7 2fb “nick” "nick" "public" a09 ce0 4a7 5ec master my repo e4a public/master git remote add nicknick git://github.com/nickh/project.git git remote add git://github.com/nickh/project.git
  • 263. ce0 4a7 5ec ce0 4a7 5ec developer developer e4a e4a nick jessica 24f ec5 c12 4ea df7 2fb a09 ce0 4a7 5ec ce0 4a7 5ec ce0 4a7 5ec nickh/ schacon/ jessica/ e4a e4a e4a project project project 24f ec5 c12 4ea df7 2fb "nick" "public" "jess" a09 ce0 4a7 5ec master my repo e4a public/master git remote add add jess git://github.com/jessica/project.git git remote jess git://github.com/jessica/project.git
  • 264. ce0 4a7 5ec ce0 4a7 5ec developer developer e4a e4a nick jessica 24f ec5 c12 4ea df7 2fb a09 ce0 4a7 5ec ce0 4a7 5ec ce0 4a7 5ec nickh/ schacon/ jessica/ e4a e4a e4a project project project 24f ec5 c12 4ea df7 2fb "nick" "public" “jess” "jess" a09 ce0 4a7 5ec master my repo e4a public/master git remote add add jess git://github.com/jessica/project.git git remote jess git://github.com/jessica/project.git
  • 265. 5ec ce0 4a7 5ec ce0 4a7 5ec schacon/ jessica/ e4a e4a project ce0 4a7 5ec project ce0 4a7 5ec c12 developer 4ea df7 2fb developer e4a e4a "public" nick "jess" a09 jessica 24f ec5 c12 4ea df7 2fb a09 ce0 4a7 5ec master ce0 4a7 5ec ce0 4a7 5ec nickh/ schacon/ jessica/ my repo e4a public/master e4a e4a project project project 24f ec5 c12 nick/master 4ea df7 2fb "nick" "public" "jess" a09 git fetch nick ce0 4a7 5ec master my repo e4a public/master git fetch nick git remote add jess git://github.com/jessica/project.git
  • 266. ce0 4a7 5ec ce0 4a7 5ec developer developer e4a e4a nick jessica 24f ec5 c12 4ea df7 2fb a09 ce0 4a7 5ec ce0 4a7 5ec ce0 4a7 5ec nickh/ schacon/ jessica/ e4a e4a e4a project project project 24f ec5 c12 4ea df7 2fb "nick" "public" "jess" a09 ce0 4a7 5ec master master my repo e4a public/master public/master 24f ec5 c12 nick/master git fetch nick git remote add jess git://github.com/jessica/project.git git fetch nick
  • 267. ce0 4a7 5ec ce0 4a7 5ec developer developer e4a e4a nick jessica 24f ec5 c12 4ea df7 2fb a09 ce0 4a7 5ec ce0 4a7 5ec ce0 4a7 5ec nickh/ schacon/ jessica/ e4a e4a e4a project project project 24f ec5 c12 4ea df7 2fb "nick" "public" "jess" a09 ce0 4a7 5ec master my repo e4a public/master 24f ec5 c12 nick/master git fetch nick
  • 268. nickh/ schacon/ jessic e4a e4a project project proje 24f ec5 c12 ce0 4a7 5ec ce0 4a7 5ec developer "nick" "public" developer "jess e4a e4a nick jessica 24f ec5 c12 4ea df7 2fb a09 ce0 4a7 5ec master ce0 4a7 5ec ce0 4a7 5ec my repo e4a ce0 4a7 5ec public/ nickh/ schacon/ jessica/ e4a e4a 24f e4a ec5 c12 nick/ma project project project 24f ec5 c12 4ea 4ea df7 df7 2fb 2fb jess/ma "nick" "public" "jess" a09 a09 git fetch jess ce0 4a7 5ec master master my repo e4a public/master public/master 24f ec5 c12 nick/master git fetchnick git fetch jess git remote add jess git://github.com/jessica/project.git
  • 269. ce0 ce0 4a7 4a7 5ec 5ec ce0 ce0 4a7 4a7 5ec 5ec developer developer developer developer e4a e4a e4a e4a nick nick jessica jessica 24f 24f ec5 ec5 c12 c12 4ea 4ea df7 df7 2fb 2fb a09 a09 ce0 ce0 4a7 4a7 5ec 5ec ce0 ce0 4a7 4a7 5ec 5ec ce0 ce0 4a7 4a7 5ec 5ec nickh/ nickh/ schacon/ schacon/ jessica/ jessica/ e4a e4a e4a e4a e4a e4a project project project project project project 24f 24f ec5 ec5 c12 c12 4ea 4ea df7 df7 2fb 2fb "nick" "public" "jess" a09 a09 ce0 ce0 4a7 4a7 5ec 5ec master master master my repo my repo e4a e4a public/master public/master public/master 24f 24f ec5 ec5 c12 c12 nick/master nick/master 4ea df7 2fb jess/master a09 git fetchnick jess git remote add jess git://github.com/jessica/project.git git fetch jess
  • 270. ce0 4a7 5ec ce0 4a7 5ec developer developer e4a e4a nick jessica 24f ec5 c12 4ea df7 2fb a09 ce0 4a7 5ec ce0 4a7 5ec ce0 4a7 5ec nickh/ schacon/ jessica/ e4a e4a e4a project project project 24f ec5 c12 4ea df7 2fb "nick" "public" "jess" a09 ce0 4a7 5ec master my repo e4a public/master 24f ec5 c12 nick/master 4ea df7 2fb jess/master a09 git fetch jess
  • 271. ce0 4a7 5ec ce0 4a7 5ec developer developer e4a e4a nick jessica 24f ec5 c12 4ea df7 2fb a09 ce0 4a7 5ec ce0 4a7 5ec ce0 4a7 5ec nickh/ schacon/ jessica/ e4a e4a e4a project project project 24f ec5 c12 4ea df7 2fb "nick" "public" "jess" a09 ce0 4a7 5ec my repo e4a public/master 24f ec5 c12 nick/master 4ea df7 2fb jess/master a09 c63 b3b master git merge nick jess
  • 272. ce0 4a7 5ec ce0 4a7 5ec developer developer e4a e4a nick jessica 24f ec5 c12 4ea df7 2fb a09 ce0 4a7 5ec ce0 4a7 5ec ce0 4a7 5ec nickh/ schacon/ jessica/ e4a e4a e4a project project project 24f ec5 c12 24f ec5 c12 4ea df7 2fb "nick" "public" 4ea df7 2fb "jess" a09 a09 c63 b3b ce0 4a7 5ec my repo e4a 24f ec5 c12 nick/master 4ea df7 2fb jess/master a09 c63 b3b master public/master git push public

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. think of it more like this. in source control, you have systems that store file versions as deltas, and those that store them as a DAG\n
  18. think of it more like this. in source control, you have systems that store file versions as deltas, and those that store them as a DAG\n
  19. think of it more like this. in source control, you have systems that store file versions as deltas, and those that store them as a DAG\n
  20. think of it more like this. in source control, you have systems that store file versions as deltas, and those that store them as a DAG\n
  21. think of it more like this. in source control, you have systems that store file versions as deltas, and those that store them as a DAG\n
  22. think of it more like this. in source control, you have systems that store file versions as deltas, and those that store them as a DAG\n
  23. think of it more like this. in source control, you have systems that store file versions as deltas, and those that store them as a DAG\n
  24. think of it more like this. in source control, you have systems that store file versions as deltas, and those that store them as a DAG\n
  25. think of it more like this. in source control, you have systems that store file versions as deltas, and those that store them as a DAG\n
  26. think of it more like this. in source control, you have systems that store file versions as deltas, and those that store them as a DAG\n
  27. think of it more like this. in source control, you have systems that store file versions as deltas, and those that store them as a DAG\n
  28. think of it more like this. in source control, you have systems that store file versions as deltas, and those that store them as a DAG\n
  29. think of it more like this. in source control, you have systems that store file versions as deltas, and those that store them as a DAG\n
  30. think of it more like this. in source control, you have systems that store file versions as deltas, and those that store them as a DAG\n
  31. think of it more like this. in source control, you have systems that store file versions as deltas, and those that store them as a DAG\n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n
  65. \n
  66. \n
  67. \n
  68. \n
  69. \n
  70. \n
  71. \n
  72. \n
  73. \n
  74. \n
  75. \n
  76. \n
  77. \n
  78. \n
  79. \n
  80. \n
  81. \n
  82. \n
  83. \n
  84. \n
  85. \n
  86. \n
  87. \n
  88. \n
  89. \n
  90. \n
  91. \n
  92. \n
  93. the index is a cache that sits in-between your temporary working directory and your permanent repository\n
  94. the index is a cache that sits in-between your temporary working directory and your permanent repository\n
  95. the index is a cache that sits in-between your temporary working directory and your permanent repository\n
  96. the index is a cache that sits in-between your temporary working directory and your permanent repository\n
  97. \n
  98. \n
  99. \n
  100. \n
  101. \n
  102. \n
  103. \n
  104. \n
  105. \n
  106. \n
  107. \n
  108. \n
  109. \n
  110. the index is a cache that sits in-between your temporary working directory and your permanent repository\n
  111. when you run &amp;#x2018;git add&amp;#x2019; on files, it caches the snapshot of those versions of the files in the index\n
  112. \n
  113. \n
  114. \n
  115. \n
  116. \n
  117. \n
  118. \n
  119. \n
  120. \n
  121. \n
  122. \n
  123. \n
  124. \n
  125. \n
  126. \n
  127. \n
  128. \n
  129. \n
  130. \n
  131. \n
  132. \n
  133. \n
  134. \n
  135. \n
  136. \n
  137. \n
  138. \n
  139. \n
  140. when you run &amp;#x2018;git add&amp;#x2019; on files, it caches the snapshot of those versions of the files in the index\n
  141. then when you run &amp;#x2018;git commit&amp;#x2019;, it actually writes the commit object pointing not to the versions of the files in your working directory, but what they looked like when you &amp;#x2018;git added&amp;#x2019; them\n
  142. \n
  143. \n
  144. \n
  145. \n
  146. \n
  147. \n
  148. \n
  149. \n
  150. \n
  151. \n
  152. \n
  153. \n
  154. \n
  155. \n
  156. \n
  157. \n
  158. \n
  159. \n
  160. \n
  161. \n
  162. \n
  163. \n
  164. \n
  165. \n
  166. \n
  167. \n
  168. \n
  169. \n
  170. \n
  171. \n
  172. \n
  173. \n
  174. \n
  175. \n
  176. \n
  177. \n
  178. \n
  179. \n
  180. \n
  181. \n
  182. \n
  183. \n
  184. \n
  185. \n
  186. \n
  187. \n
  188. \n
  189. \n
  190. \n
  191. \n
  192. \n
  193. \n
  194. \n
  195. \n
  196. which gives us a directed acyclic graph like this\n
  197. which gives us a directed acyclic graph like this\n
  198. \n
  199. references are lightweight, easily movable pointers to a commit that signifies the head of a local or remote branch\n
  200. references are lightweight, easily movable pointers to a commit that signifies the head of a local or remote branch\n
  201. \n
  202. \n
  203. \n
  204. \n
  205. \n
  206. \n
  207. \n
  208. \n
  209. \n
  210. \n
  211. \n
  212. \n
  213. \n
  214. \n
  215. \n
  216. \n
  217. \n
  218. \n
  219. \n
  220. \n
  221. \n
  222. \n
  223. \n
  224. \n
  225. \n
  226. \n
  227. \n
  228. \n
  229. \n
  230. \n
  231. \n
  232. \n
  233. \n
  234. \n
  235. \n
  236. \n
  237. \n
  238. \n
  239. \n
  240. \n
  241. \n
  242. \n
  243. \n
  244. \n
  245. \n
  246. \n
  247. \n
  248. \n
  249. \n
  250. \n
  251. \n
  252. \n
  253. \n
  254. \n
  255. \n
  256. \n
  257. \n
  258. \n
  259. \n
  260. \n
  261. \n
  262. \n
  263. \n
  264. \n
  265. \n
  266. \n
  267. \n
  268. \n
  269. \n
  270. \n
  271. \n
  272. \n
  273. \n
  274. \n
  275. \n
  276. \n
  277. \n
  278. \n
  279. \n
  280. \n
  281. \n
  282. \n
  283. \n
  284. \n
  285. \n
  286. \n
  287. \n
  288. \n
  289. \n
  290. \n
  291. \n
  292. \n
  293. \n
  294. \n
  295. \n
  296. \n
  297. \n
  298. \n
  299. \n
  300. \n
  301. \n
  302. \n
  303. \n
  304. \n
  305. \n
  306. \n
  307. \n
  308. \n
  309. \n
  310. \n
  311. \n
  312. \n
  313. \n
  314. \n
  315. think of it more like this. in source control, you have systems that store file versions as deltas, and those that store them as a DAG\n
  316. think of it more like this. in source control, you have systems that store file versions as deltas, and those that store them as a DAG\n
  317. think of it more like this. in source control, you have systems that store file versions as deltas, and those that store them as a DAG\n
  318. \n
  319. \n
  320. \n
  321. \n
  322. \n
  323. \n
  324. \n
  325. \n
  326. \n
  327. \n
  328. \n
  329. \n
  330. \n
  331. \n
  332. \n
  333. \n
  334. \n
  335. \n
  336. \n
  337. \n
  338. \n
  339. \n
  340. \n
  341. \n
  342. \n
  343. \n
  344. \n
  345. \n
  346. \n
  347. \n
  348. \n
  349. \n
  350. \n
  351. \n
  352. \n
  353. \n
  354. \n
  355. \n
  356. \n
  357. \n
  358. \n
  359. \n
  360. \n
  361. \n
  362. \n
  363. \n
  364. \n
  365. \n
  366. \n
  367. \n
  368. \n
  369. \n
  370. \n
  371. \n
  372. \n
  373. \n
  374. \n