WorkShopserver-side engineer    Daichi Hirata
PurposeGitに対しての共通認識Common understanding for Gitノウハウの共有Sharing of knowledge
AgendaGitの基礎知識Basic knowledgeTips
Basic knowledge
SVN       Remote RepositoryCommit / Checkout          Working Tree
Git         Remote Repository             Pull / Push                    .git internalRepository                          ...
ComponentRepository           Working Tree             Index
Component                     git checkoutRepository                             Working Tree いつでもリポジトリから以前の状態の ワーキングツリーをチ...
Component                           git checkoutワーキングツリーの変更がインデックスへ登録される   RepositoryChange the working tree to the index ...
Component                 git checkout                インデックスの変更がリポジトリ                へコミットされるRepository                   ...
Component  Repository                           Working Tree一時的な変更やコミットできない                               git stash変更を退避させ...
CommitファイルツリーFile tree付加情報Additional information直前のコミットLast commit
CommitファイルツリーFile tree付加情報Additional information直前のコミットLast commit
Commitファイルツリー  どれか1つでも異なれば同じファイFile tree       ル、同じ内容でも異なるコミット付加情報 the same file with different,  Commit     even with the ...
CommitファイルツリーFile tree付加情報Additional information直前のコミットLast commit
Commit  任意のコミットから最初のコミット(initial commit) からそのコミットに      至る全ての履歴が取得できる  History all the way to commit from the(initial comm...
Branchあるコミット(そのブランチの最新のコミット)に至る履歴と将来History and future leading to the (mostrecent commit on that branch) committhere.
Branch
Merge          master   hotfixC0   C1     C2
Merge          master   hotfixC0   C1     C2      C3
Merge    master               hotfixC0   C1   C2    C3
Merge    masterFast foward    hotfixC0   C1   C2    C3
Merge           masterC0   C1     C2        #11                 C3   C4
Merge           masterC0   C1     C2        #11                 C3   C4
Merge           masterC0   C1     C2        #11                 C3   C4
Merge           masterC0   C1     C2        #11                 C3   C4
Merge                         masterC0   C1        C2          C5          C3        C4                                #11
Rebase            masterC0   C1      C2        #11                  C3   C4
Rebase            masterC0   C1      C2        #11                  C3   C4
Rebase                                  master           master                  #11C0   C1      C2         C3’          C...
Rebase              masterC0   C1        C4        C7        #12          C2        C3        C6               C5        C...
Rebase              masterC0   C1        C4        C7        #12          C2        C3        C6               C5        C...
Rebase                  master  C0           C1           C4            C7        #12                     C2              ...
Tips
$git stash$git bisect$git commit --amend$git rebase -i HEAD~x$git cherry-pick$git reflog         tips1: Useful Commands
$git stash [save message]$git stash list$git stash pop [stash@{x}]$git stash apply [stash@{x}]$git stash drop stash@{x}$gi...
$git stash [save message]$git stash list$git stash pop [stash@{x}]$git stash apply [stash@{x}]$git stash drop stash@{x}   ...
$git stash [save message]$git stash list$git stash pop [stash@{x}]$git stash apply [stash@{x}]$git stash drop stash@{x}$gi...
$git stash$git bisect$git commit --amend$git rebase -i HEAD~x$git cherry-pick$git reflog         tips1: Useful Commands
$git bisect start$git bisect bad$git bisect good rev$git bisect next$git bisect bad/good$git bisect reset$git bisect run <...
$git stash$git bisect$git commit --amend$git rebase -i HEAD~x$git cherry-pick$git reflog         tips1: Useful Commands
$git stash$git bisect$git commit --amend$git rebase -i HEAD~x$git cherry-pick$git reflog         tips1: Useful Commands
$git stash$git bisect$git commit --amend$git rebase -i HEAD~x$git cherry-pick$git reflog         tips1: Useful Commands
$git stash$git bisect$git commit --amend$git rebase -i HEAD~x$git cherry-pick$git reflog         tips1: Useful Commands
[color]                               [merge]  diff = auto                             tool = vimdiff  status = auto      ...
tips2: Setting - gst
tips2: Setting - ignore-changes
tips2: Setting - prompt
Upcoming SlideShare
Loading in …5
×

Git社内勉強会

1,949 views

Published on

Nubee Tokyo Oct. 3, 2012

0 Comments
6 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,949
On SlideShare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
26
Comments
0
Likes
6
Embeds 0
No embeds

No notes for slide

Git社内勉強会

  1. 1. WorkShopserver-side engineer Daichi Hirata
  2. 2. PurposeGitに対しての共通認識Common understanding for Gitノウハウの共有Sharing of knowledge
  3. 3. AgendaGitの基礎知識Basic knowledgeTips
  4. 4. Basic knowledge
  5. 5. SVN Remote RepositoryCommit / Checkout Working Tree
  6. 6. Git Remote Repository Pull / Push .git internalRepository Working Tree stash Index
  7. 7. ComponentRepository Working Tree Index
  8. 8. Component git checkoutRepository Working Tree いつでもリポジトリから以前の状態の ワーキングツリーをチェックアウト可能 You can check out the working tree from the repository Index at any time of the previous state.
  9. 9. Component git checkoutワーキングツリーの変更がインデックスへ登録される RepositoryChange the working tree to the index isregistered. Working Tree git add Index
  10. 10. Component git checkout インデックスの変更がリポジトリ へコミットされるRepository Working Tree Index changes are committed to the repository. git commit git add Index
  11. 11. Component Repository Working Tree一時的な変更やコミットできない git stash変更を退避させるEvacuate and commit changes that cannot be a temporary change. Index stash
  12. 12. CommitファイルツリーFile tree付加情報Additional information直前のコミットLast commit
  13. 13. CommitファイルツリーFile tree付加情報Additional information直前のコミットLast commit
  14. 14. Commitファイルツリー どれか1つでも異なれば同じファイFile tree ル、同じ内容でも異なるコミット付加情報 the same file with different, Commit even with the same content butAdditional information different if any one.直前のコミットLast commit
  15. 15. CommitファイルツリーFile tree付加情報Additional information直前のコミットLast commit
  16. 16. Commit 任意のコミットから最初のコミット(initial commit) からそのコミットに 至る全ての履歴が取得できる History all the way to commit from the(initial commit) can be obtained from the first commit commit any.
  17. 17. Branchあるコミット(そのブランチの最新のコミット)に至る履歴と将来History and future leading to the (mostrecent commit on that branch) committhere.
  18. 18. Branch
  19. 19. Merge master hotfixC0 C1 C2
  20. 20. Merge master hotfixC0 C1 C2 C3
  21. 21. Merge master hotfixC0 C1 C2 C3
  22. 22. Merge masterFast foward hotfixC0 C1 C2 C3
  23. 23. Merge masterC0 C1 C2 #11 C3 C4
  24. 24. Merge masterC0 C1 C2 #11 C3 C4
  25. 25. Merge masterC0 C1 C2 #11 C3 C4
  26. 26. Merge masterC0 C1 C2 #11 C3 C4
  27. 27. Merge masterC0 C1 C2 C5 C3 C4 #11
  28. 28. Rebase masterC0 C1 C2 #11 C3 C4
  29. 29. Rebase masterC0 C1 C2 #11 C3 C4
  30. 30. Rebase master master #11C0 C1 C2 C3’ C4’ cherry-pick
  31. 31. Rebase masterC0 C1 C4 C7 #12 C2 C3 C6 C5 C8 #13
  32. 32. Rebase masterC0 C1 C4 C7 #12 C2 C3 C6 C5 C8 #13
  33. 33. Rebase master C0 C1 C4 C7 #12 C2 C3 C6 C5 C8 #13$ git rebase --onto master #12 #13
  34. 34. Tips
  35. 35. $git stash$git bisect$git commit --amend$git rebase -i HEAD~x$git cherry-pick$git reflog tips1: Useful Commands
  36. 36. $git stash [save message]$git stash list$git stash pop [stash@{x}]$git stash apply [stash@{x}]$git stash drop stash@{x}$git stash clear $ git stash
  37. 37. $git stash [save message]$git stash list$git stash pop [stash@{x}]$git stash apply [stash@{x}]$git stash drop stash@{x} $ git stash
  38. 38. $git stash [save message]$git stash list$git stash pop [stash@{x}]$git stash apply [stash@{x}]$git stash drop stash@{x}$git stash clear $ git stash
  39. 39. $git stash$git bisect$git commit --amend$git rebase -i HEAD~x$git cherry-pick$git reflog tips1: Useful Commands
  40. 40. $git bisect start$git bisect bad$git bisect good rev$git bisect next$git bisect bad/good$git bisect reset$git bisect run <test_file> $git bisect
  41. 41. $git stash$git bisect$git commit --amend$git rebase -i HEAD~x$git cherry-pick$git reflog tips1: Useful Commands
  42. 42. $git stash$git bisect$git commit --amend$git rebase -i HEAD~x$git cherry-pick$git reflog tips1: Useful Commands
  43. 43. $git stash$git bisect$git commit --amend$git rebase -i HEAD~x$git cherry-pick$git reflog tips1: Useful Commands
  44. 44. $git stash$git bisect$git commit --amend$git rebase -i HEAD~x$git cherry-pick$git reflog tips1: Useful Commands
  45. 45. [color] [merge] diff = auto tool = vimdiff status = auto [core] branch = auto excludesfile = ~/.gitignore ui = auto[alias] co = checkout st = status -sb wd = diff --word-diff tlog = log --graph --pretty=oneline --decorate --date=short --abbrev-commit --branches hist = log --pretty=format:"%C(yellow)%h %C(White)%ad | %C(White)%s%d %C(Red)[%an]" --graph --date=short tips2: Setting
  46. 46. tips2: Setting - gst
  47. 47. tips2: Setting - ignore-changes
  48. 48. tips2: Setting - prompt

×