80. $ 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
81. $ 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
82. $ 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
83. $ 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
84. A Basic Workflow
Edit files
Stage the changes
Review your changes
Commit the changes
88. $ git add main.py
$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>.
#
# modified: main.py
#
89. $ git add main.py
$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>.
#
# modified: main.py
#
90. $ git add main.py
$ git status
# On branch master
# Changes to be committed:
THAT ARE STAGED
# (use "git reset HEAD <file>.
#
# modified: main.py
#
94. $ 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
#
95. $ 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
96. $ 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
97. $ 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
98. $ 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
#
99. $ 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
#
100. $ 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
#
101. $ 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
#
102. 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 = webapp.WSGIApplication application = webapp.WSGIApplication
([('/' ([('/'
debug=True) debug=True)
wsgiref.handlers.CGIHandler().run wsgiref.handlers.CGIHandler().run
(applicat (applicat
if __name__ == '__main__': if __name__ == '__main__':
main() main()
103. 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 = webapp.WSGIApplication application = webapp.WSGIApplication
([('/' ([('/'
debug=True) debug=True)
wsgiref.handlers.CGIHandler().run wsgiref.handlers.CGIHandler().run
(applicat (applicat
if __name__ == '__main__': if __name__ == '__main__':
main() main()
112. $ 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
113. $ 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
114. $ 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
128. 77d3001a1de6bf8f5e431972fe4d25b01e595c0b
ae668..
commit size
tree c4ec5
parent a149e
author Scott
committer Scott
my commit message goes here
and it is really, really cool
129. 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
130. 77d3001a1de6bf8f5e431972fe4d25b01e595c0b
ae668..
commit size
tree c4ec5
parent a149e
author Scott
committer Scott
my commit message goes here
and it is really, really cool
131. 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
132. 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
133. 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
134. 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
135. 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
194. • clone the code that is in production
• create a branch for issue #53 (iss53)
• work for 10 minutes
• someone asks for a hotfix for issue #102
• checkout ‘production’
• create a branch (iss102)
• fix the issue
• checkout ‘production’, merge ‘iss102’
• push ‘production’
• checkout ‘iss53’ and keep working
248. local repo
public repo public repo
internet
local repo
A B C
249. local repo
public repo public repo
A B C
internet
git push
(ssh)
local repo
A B C
250. local repo
git fetch A B C
(git)
public repo public repo
A B C
internet
git push
(ssh)
local repo
A B C
251. 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
252. 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
253. 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
254. 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