git studynotes

22
git A Study Note Richard Kuo

Upload: richard-kuo

Post on 22-Apr-2015

302 views

Category:

Documents


2 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Git studynotes

git  A  Study  Note  

 Richard  Kuo  

Page 2: Git studynotes

What?  Why?  How?  When?  

Crea3ve  Common  BY-­‐AS-­‐NC   2  3/1/13  

Page 3: Git studynotes

What  is  git?  

•  Free  open  source  soDware  version  control  tool.  

•  Created  by  Linus  Torvalds  In  2  weeks  for  managing  Linux  code.  

•  GitHub:  soDware  hos3ng  site  -­‐  On  16  January  2013,  GitHub  announced  it  had  passed  the  3  million  users  mark  and  now  hos3ng  more  than  5  million  repositories.  

Crea3ve  Common  BY-­‐AS-­‐NC   3  3/1/13  

Page 4: Git studynotes

Why  git?  

•  Distributed.  •  Full  history  repository.  •  No  network  requirement,  work  offline  at  anywhere  and  any3me.  

•  Small  foot  print  and  fast.  •  Flexible,  accommodate  any  workflow.  •  Pseudo  industry  standard.  

Crea3ve  Common  BY-­‐AS-­‐NC   4  3/1/13  

Page 5: Git studynotes

Object  Database  http://www.youtube.com/watch?v=GYnOwPl8yCE  

3/1/13   Crea3ve  Common  BY-­‐AS-­‐NC   5  

Page 6: Git studynotes

4  Object  Types  

•  Blob  (content)  -­‐  Header  -­‐  File  content.  

•  Tree  (directory  lis3ngs)  -­‐  Header  -­‐  For  each  file  or  directory  

-­‐  File  permission  -­‐  Object  type  -­‐  SHA-­‐1  -­‐  File  /  Directory  name  

 

3/1/13   Crea3ve  Common  BY-­‐AS-­‐NC   6  

•  Tag  (meta-­‐data  of  a  commit)  –  Name  –  Tagger  –  Date  –  Commit  hash  –  …  

•  Commit  (snapshots)  –  Author  informa3on  –  Commicer  informa3on  –  Commit  message  –  SHA-­‐1  of  any  parent  commits  –  SHA-­‐1  of  the  tree  that  the  

commit  points  to  

Page 7: Git studynotes

GIT  Object  Model  

3/1/13   Crea3ve  Common  BY-­‐AS-­‐NC   7  

Page 8: Git studynotes

References  

3/1/13   Crea3ve  Common  BY-­‐AS-­‐NC   8  

Page 9: Git studynotes

Git  Commit  

3/1/13   Crea3ve  Common  BY-­‐AS-­‐NC   9  

Page 10: Git studynotes

Scenario  

3/1/13   Crea3ve  Common  BY-­‐AS-­‐NC   10  

Page 11: Git studynotes

hcp://www.technovelty.org/linux/git-­‐workflow.html  Crea3ve  Common  BY-­‐AS-­‐NC   11  3/1/13  

Page 12: Git studynotes

GIT  Expressed  in  UML  hcp://utsl.gen.nz/talks/git-­‐svn/intro.html    

3/1/13   Crea3ve  Common  BY-­‐AS-­‐NC   12  

Page 13: Git studynotes

Crea3ve  Common  BY-­‐AS-­‐NC   13  3/1/13  

3  +  1  Areas  

Page 14: Git studynotes

Important  Concepts  

•  Manipulate  graph.  •  Track  contents,  not  files.  •  Object  name  is  hash  code  which  generated  from  its  content.  

•  Immutable  objects,  move  reference  pointers.  

3/1/13   Crea3ve  Common  BY-­‐AS-­‐NC   14  

Page 15: Git studynotes

Demo  

Page 16: Git studynotes

Credit:  hcp://nvie.com/posts/a-­‐successful-­‐git-­‐branching-­‐model/  Crea3ve  Common  BY-­‐AS-­‐NC   16  3/1/13  

Page 17: Git studynotes

3/1/13   Crea3ve  Common  BY-­‐AS-­‐NC   17  

Page 18: Git studynotes

3/1/13   Crea3ve  Common  BY-­‐AS-­‐NC   18  

Page 19: Git studynotes

References  •  Books  and  tutorials  

–  Git  Immersion  –  Cheat  Sheet  –  A  Visual  Git  Reference  

•  Workflow    –  Commit  policy  –  A  successful  Git  branching  model  

•  Credit:  Patrick  Hogan  for  Images  for  slides  5,  7,  8,  10  about  objects  database.  

Crea3ve  Common  BY-­‐AS-­‐NC   19  3/1/13  

Page 20: Git studynotes

Backup  Slides  

Page 21: Git studynotes

Crea3ve  Common  BY-­‐AS-­‐NC   21  

hcps://raw.github.com/macharrison/Git-­‐Supervisual-­‐Cheatsheet/master/gitcheat.png    

3/1/13  

Page 22: Git studynotes

Crea3ve  Common  BY-­‐AS-­‐NC   22  3/1/13