0
Git - Step by step
Goal                 We would like to make snapshots                     of the university thesis.Balabit Open Academy, Ve...
Thesis                images/                     univ_logo.png                main_page.tex                introduction.t...
Create backup        images                                        backup            univ_logo.png                      co...
Later...                                               time             2011-09-11                               2011-10-0...
++size          backup/             2011-09-11                        [300 bytes]                                         ...
Changes by the time...             2011-09-11                        2011-10-01_images_ready                images        ...
Optimizing             2011-09-11                        2011-10-01_kepek_kesz                images                      ...
Transparency                                               2011-10-01_kepek_kesz                images                    ...
Transparency             2011-10-01_kepek_kesz                images                    univ_logo.png                   co...
Stage             2011-09-11                        2011-10-01_images_ready                images                         ...
Commit                           Stage      Date                Title             2011-09-11                          2011...
Commits                                                      head                                               ListBalabi...
Structure                                               Stage {                                                 ... // cha...
Operations                                 Stage {                                                  ... // changed files  ...
Operations                                 Stage {                                                  ... // changed files  ...
Process                                               git init // head = 0 stage = new Stage; stage->add("/README.txt");  ...
headBalabit Open Academy, Veszprém, Nov 30, 2011      twitter.com/nucc
List                                               <                               Directed Tree                          ...
Commits                                                    head                                           Directed treeBal...
Checkout  // means change the head  git_checkout(Commit * commit)  {    head = commit;                             head  }...
Branches                                                            head  Commit * master;  Commit * branch1;             ...
Tags  Commit * const tag1;  Commit * const tag2;  git_checkout(tag1) <=> head = tag1                                      ...
Synchronizing                                               branch1                                               masterBa...
Pick                                               branch1                                               master           ...
Pick                                               branch1                                                         master ...
Rebase                                                        branch1                                                     ...
branch1                                                master                                      git rebase branch1Balab...
branch1                                                master                                      git rebase branch1Balab...
!=   branch1                                                    master                                      git rebase bra...
branch1                                      git rebase branch1Balabit Open Academy, Veszprém, Nov 30, 2011               ...
branch1                                      git rebase branch1Balabit Open Academy, Veszprém, Nov 30, 2011               ...
branch1                                      git rebase branch1Balabit Open Academy, Veszprém, Nov 30, 2011               ...
branch1                                      git rebase branch1Balabit Open Academy, Veszprém, Nov 30, 2011               ...
branch1                                                                  master                                      git r...
Merge                                                branch1                                                master        ...
Merge                                                branch1                                                          mast...
Backup?Balabit Open Academy, Veszprém, Nov 30, 2011   twitter.com/nucc
Backup?                                                PenDrive                                          D:           NFS ...
Backup?                                                PenDrive                                          D:           NFS ...
Sharing?Balabit Open Academy, Veszprém, Nov 30, 2011   twitter.com/nucc
Sharing?                           HTTP                                               Samba                               ...
List                                               <                               Directed Tree                          ...
Directed Graph                                               branch1                                               masterB...
Directed Graph                          branch1                           masterBalabit Open Academy, Veszprém, Nov 30, 20...
Directed Graph                          b                          mBalabit Open Academy, Veszprém, Nov 30, 2011   twitter...
Directed Graph                                                        HTTP                                        SSH     ...
Directed Graph                                                        HTTP                                        SSH     ...
Git remote                                                          http                                        SSH       ...
Git remote   Local                          b                          m                                               b  ...
www.github.com                                               b                                               m            ...
Clone                                                    b                                                    m           ...
Clone      Local                              b                origin   b                              m                  ...
More remotes                                                                 http                                         ...
Operations    local                                                        github                                         ...
Operations    local                                                              github                                   ...
Operations                                   git push origin master    local                                              ...
Here and there...    local                                                           github                               ...
Here and there...    local                                                              github                            ...
Here and there...                                 git push -f origin master    local                                      ...
Balabit Open Academy, Veszprém, Nov 30, 2011   twitter.com/nucc
b                                                   m                                                           b         ...
b                                                   m                                                           b         ...
?                                       twitter.com/nuccBalabit Open Academy, Veszprém, Nov 30, 2011              twitter....
Upcoming SlideShare
Loading in...5
×

Git thinking

305

Published on

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
305
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
3
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Transcript of "Git thinking"

  1. 1. Git - Step by step
  2. 2. Goal We would like to make snapshots of the university thesis.Balabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  3. 3. Thesis images/ univ_logo.png main_page.tex introduction.texBalabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  4. 4. Create backup images backup univ_logo.png copy 2011-09-11 main_page.tex 2011-10-01_images_ready introduction.tex 2011-11-22_releaseBalabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  5. 5. Later... time 2011-09-11 2011-10-01_images_ready images images univ_logo.png univ_logo.png main_page.tex cover_image.png introduction.tex main_page.tex introduction.tex first_chapter.texBalabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  6. 6. ++size backup/ 2011-09-11 [300 bytes] time 2011-10-01_images_ready [228 kbytes] 2011-11-22_release [500 kbytes] Sum: 728 kbytesBalabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  7. 7. Changes by the time... 2011-09-11 2011-10-01_images_ready images images univ_logo.png univ_logo.png main_page.tex cover_image.png introduction.tex main_page.tex introduction.tex first_chapter.texBalabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  8. 8. Optimizing 2011-09-11 2011-10-01_kepek_kesz images images univ_logo.png univ_logo.png cover_image.png main_page.tex main_page.tex introduction.tex introduction.tex first_chapter.texBalabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  9. 9. Transparency 2011-10-01_kepek_kesz images images univ_logo.png cover_image.png main_page.tex main_page.tex introduction.tex first_chapter.texBalabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  10. 10. Transparency 2011-10-01_kepek_kesz images univ_logo.png cover_image.png main_page.tex introduction.tex first_chapter.texBalabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  11. 11. Stage 2011-09-11 2011-10-01_images_ready images images univ_logo.png univ_logo.png cover_image.png main_page.tex main_page.txt introduction.tex introduction.tex first_chapter.texBalabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  12. 12. Commit Stage Date Title 2011-09-11 2011-10-01_images... images images univ_logo.png univ_logo.png cover_image.png main_page.tex main_page.tex introduction.tex introduction.tex first_chapter.texBalabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  13. 13. Commits head ListBalabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  14. 14. Structure Stage { ... // changed files } Commit { Date date; String title; Stage * stage; Commit * parent; } Commit * head; headBalabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  15. 15. Operations Stage { ... // changed files } Commit { Date date; String title; Stage * stage; Commit * parent; } head = 0; // beginning Commit * head; git_commit(Stage * stage, String title) { Commit * commit = new Commit; commit->date = date(); commit->title = title; commit->stage = stage; commit.parent = head; head head = commit; }Balabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  16. 16. Operations Stage { ... // changed files } Commit { Date date; String title; Stage * stage; Commit * parent; } head = 0; // beginning Commit * head; git_commit(Stage * stage, String title) { Commit * commit = new Commit; commit->date = date(); commit->title = title; commit->stage = stage; commit.parent = head; head = commit; } headBalabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  17. 17. Process git init // head = 0 stage = new Stage; stage->add("/README.txt"); git add README.txt git_commit(stage, "init repo"); git commit -m “init repo” stage = new Stage; git add “README.txt” stage->add("/README.txt"); stage->add("/main.cpp"); git add “main.cpp” git_commit(stage, "Added main.cpp"); git commit -m “Added main.cpp”Balabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  18. 18. headBalabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  19. 19. List < Directed Tree Directed Graph <Balabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  20. 20. Commits head Directed treeBalabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  21. 21. Checkout // means change the head git_checkout(Commit * commit) { head = commit; head } git_checkout(0x45F34FE2) ???????Balabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  22. 22. Branches head Commit * master; Commit * branch1; branch1 git_checkout(branch1) <=> head = branch1 masterBalabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  23. 23. Tags Commit * const tag1; Commit * const tag2; git_checkout(tag1) <=> head = tag1 tag1 tag1Balabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  24. 24. Synchronizing branch1 masterBalabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  25. 25. Pick branch1 master git cherry-pick [commit_id]Balabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  26. 26. Pick branch1 master git cherry-pick [commit_id]Balabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  27. 27. Rebase branch1 master building new base rebase master to branch1Balabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  28. 28. branch1 master git rebase branch1Balabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  29. 29. branch1 master git rebase branch1Balabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  30. 30. != branch1 master git rebase branch1Balabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  31. 31. branch1 git rebase branch1Balabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  32. 32. branch1 git rebase branch1Balabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  33. 33. branch1 git rebase branch1Balabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  34. 34. branch1 git rebase branch1Balabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  35. 35. branch1 master git rebase branch1Balabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  36. 36. Merge branch1 master git merge branch1Balabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  37. 37. Merge branch1 master git merge branch1Balabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  38. 38. Backup?Balabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  39. 39. Backup? PenDrive D: NFS SSHBalabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  40. 40. Backup? PenDrive D: NFS SSH Amazon StorageBalabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  41. 41. Sharing?Balabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  42. 42. Sharing? HTTP Samba FTPBalabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  43. 43. List < Directed Tree Directed Graph <Balabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  44. 44. Directed Graph branch1 masterBalabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  45. 45. Directed Graph branch1 masterBalabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  46. 46. Directed Graph b mBalabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  47. 47. Directed Graph HTTP SSH b b m m Local b m b m GithubBalabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  48. 48. Directed Graph HTTP SSH b b m m Local b m b m GithubBalabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  49. 49. Git remote http SSH b b m m Local b m b m githubBalabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  50. 50. Git remote Local b m b m githubBalabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  51. 51. www.github.com b m githubBalabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  52. 52. Clone b m github git clone git@github.com:Nucc/check.it.gitBalabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  53. 53. Clone Local b origin b m m github git clone git@github.com:Nucc/check.it.gitBalabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  54. 54. More remotes http b m webpage local github b origin b m m git remote -a http://nucc.balabit.hu/diploma weblapBalabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  55. 55. Operations local github push b b m pull mBalabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  56. 56. Operations local github push b b m pull m git pull origin/masterBalabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  57. 57. Operations git push origin master local github push b b m pull m git pull origin/masterBalabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  58. 58. Here and there... local github backup b b m restore mBalabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  59. 59. Here and there... local github backup b b m restore m git reset --hard origin/masterBalabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  60. 60. Here and there... git push -f origin master local github backup b b m restore m git reset --hard origin/masterBalabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  61. 61. Balabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  62. 62. b m b m b m b b m b m m b m b m b mBalabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  63. 63. b m b m b m b b m b m m b m b m b mBalabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  64. 64. ? twitter.com/nuccBalabit Open Academy, Veszprém, Nov 30, 2011 twitter.com/nucc
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×