Gitのおさらい

4,170 views

Published on

Gitのオブジェクト/インデックスを理解して、直感的にGitを使いこなしましょう。
解説記事 http://d.hatena.ne.jp/ja9/20110822/1313986395

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
4,170
On SlideShare
0
From Embeds
0
Number of Embeds
1,666
Actions
Shares
0
Downloads
23
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Gitのおさらい

  1. 1. TDDBC Tokyo 1.7 for PHP 2011-08-21 @madapaja
  2. 2. < >< >
  3. 3. < >< >
  4. 4. < >< >
  5. 5. < >< >
  6. 6. 5ae168cf492bead24f9c24319e3ef2ba3d5b8f3ablob 956<?phpnamespace Xanadu;class Controller{    private $name; : :
  7. 7. 5ae168cf492bead24f9c24319e3ef2ba3d5b8f3ablob 956<?phpnamespace Xanadu;class Controller{    private $name; : :
  8. 8. 5ae168cf492bead24f9c24319e3ef2ba3d5b8f3ablob 956<?phpnamespace Xanadu;class Controller{    private $name; : :
  9. 9. a7e52bd45207ff7d202125b5eab2bdf172c506e9tree 42100644 blob 5ae168cf492bead24f9c24319e3ef2ba3d5b8f3a    Controller.php
  10. 10. a7e52bd45207ff7d202125b5eab2bdf172c506e9 tree 42mode 100644 blob 5ae168cf492bead24f9c24319e3ef2ba3d5b8f3a    Controller.php
  11. 11. a7e52bd45207ff7d202125b5eab2bdf172c506e9 tree 42mode 100644 blob 5ae168cf492bead24f9c24319e3ef2ba3d5b8f3a    Controller.php
  12. 12. a7e52bd45207ff7d202125b5eab2bdf172c506e9 tree 42mode 100644 blob 5ae168cf492bead24f9c24319e3ef2ba3d5b8f3a    Controller.php
  13. 13. a7e52bd45207ff7d202125b5eab2bdf172c506e9 tree 42mode 100644 blob 5ae168cf492bead24f9c24319e3ef2ba3d5b8f3a    Controller.php
  14. 14. 54be572c17595e83dd84bbb14cae7edb9dd65a18commit 172tree a7e52bd45207ff7d202125b5eab2bdf172c506e9author madapaja <iwasaki@cresc.com> 1313731598 +0900committer madapaja <iwasaki@cresc.com> 1313731598 +0900my first commit
  15. 15. $ git tag stable-1
  16. 16. checkout
  17. 17. checkout
  18. 18. checkout add
  19. 19. checkout addcommit
  20. 20. checkout add
  21. 21. checkout add
  22. 22. checkout addcommit
  23. 23. checkout addcommit
  24. 24. checkout add
  25. 25. checkout add
  26. 26. checkout add add
  27. 27. checkout add addcommit
  28. 28. $ cd path/to/project$ git init
  29. 29. $ cd path/to/project$ git init$ git clone git://path/to/project$ cd project
  30. 30. $ git add target.php$ git add -u         
  31. 31. $ git add target.php$ git add -u         $ git rm --cached target.php $ git rm target.php
  32. 32. $ git add target.php$ git add -u         $ git rm --cached target.php $ git rm target.php$ git status
  33. 33. $ git add target.php$ git add -u         $ git rm --cached target.php $ git rm target.php$ git status$ git diff
  34. 34. $ git add target.php$ git add -u         $ git rm --cached target.php $ git rm target.php$ git status$ git diff$ git checkout target.php
  35. 35. $ git add target.php$ git add -u         $ git rm --cached target.php $ git rm target.php$ git status$ git diff$ git checkout target.php$ git reset HEAD target.php
  36. 36. $ git diff --cached
  37. 37. $ git diff --cached$ git commit
  38. 38. $ git diff --cached$ git commit$ git commit --amend
  39. 39. $ git diff --cached$ git commit$ git commit --amend$ git reset --soft HEAD^
  40. 40. $ git diff HEAD
  41. 41. $ git diff HEADgit add -u && git commit$ git commit -a
  42. 42. $ git diff HEADgit add -u && git commit$ git commit -a$ git revert a5102ef4
  43. 43. $ git diff HEADgit add -u && git commit$ git commit -a$ git revert a5102ef4$ git reset --hard HEAD^
  44. 44. $ git checkout master
  45. 45. $ git checkout mastergit branch branch1 && git checkout branch1$ git checkout -b branch1
  46. 46. $ git checkout mastergit branch branch1 && git checkout branch1$ git checkout -b branch1$ git merge new_function$ git merge --no-commit new_function
  47. 47. $ git log
  48. 48. $ git log$ git diff HEAD^..HEAD
  49. 49. $ git log$ git diff HEAD^..HEAD$ git branch
  50. 50. $ git log$ git diff HEAD^..HEAD$ git branch$ git branch experimental
  51. 51. $ git log$ git diff HEAD^..HEAD$ git branch$ git branch experimental$ git branch -d experimental$ git branch -D experimental
  52. 52. $ git branch -r
  53. 53. $ git branch -r$ git fetch origin
  54. 54. $ git branch -r$ git fetch origin$ git merge origin/master
  55. 55. $ git branch -r$ git fetch origin$ git merge origin/master git fetch origin && git merge origin/master$ git pull origin master
  56. 56. $ git branch -r$ git fetch origin$ git merge origin/master git fetch origin && git merge origin/master$ git pull origin master$ git push origin :experimental
  57. 57. $ git branch -r$ git fetch origin$ git merge origin/master git fetch origin && git merge origin/master$ git pull origin master$ git push origin :experimental$ git push origin master

×