Successfully reported this slideshow.

Gitのおさらい

1

Share

Upcoming SlideShare
git
git
Loading in …3
×
1 of 99
1 of 99

Gitのおさらい

1

Share

Download to read offline

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

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

More Related Content

Related Books

Free with a 14 day trial from Scribd

See all

Gitのおさらい

  1. 1. TDDBC Tokyo 1.7 for PHP 2011-08-21 @madapaja
  2. 2. < >< >
  3. 3. < >< >
  4. 4. < >< >
  5. 5. < >< >
  6. 6. 5ae168cf492bead24f9c24319e3ef2ba3d5b8f3a blob 956 <?php namespace Xanadu; class Controller {     private $name; : :
  7. 7. 5ae168cf492bead24f9c24319e3ef2ba3d5b8f3a blob 956 <?php namespace Xanadu; class Controller {     private $name; : :
  8. 8. 5ae168cf492bead24f9c24319e3ef2ba3d5b8f3a blob 956 <?php namespace Xanadu; class Controller {     private $name; : :
  9. 9. a7e52bd45207ff7d202125b5eab2bdf172c506e9 tree 42 100644 blob 5ae168cf492bead24f9c24319e3ef2ba3d5b8f3a    Controller.php
  10. 10. a7e52bd45207ff7d202125b5eab2bdf172c506e9 tree 42 mode 100644 blob 5ae168cf492bead24f9c24319e3ef2ba3d5b8f3a    Controller.php
  11. 11. a7e52bd45207ff7d202125b5eab2bdf172c506e9 tree 42 mode 100644 blob 5ae168cf492bead24f9c24319e3ef2ba3d5b8f3a    Controller.php
  12. 12. a7e52bd45207ff7d202125b5eab2bdf172c506e9 tree 42 mode 100644 blob 5ae168cf492bead24f9c24319e3ef2ba3d5b8f3a    Controller.php
  13. 13. a7e52bd45207ff7d202125b5eab2bdf172c506e9 tree 42 mode 100644 blob 5ae168cf492bead24f9c24319e3ef2ba3d5b8f3a    Controller.php
  14. 14. 54be572c17595e83dd84bbb14cae7edb9dd65a18 commit 172 tree a7e52bd45207ff7d202125b5eab2bdf172c506e9 author madapaja <iwasaki@cresc.com> 1313731598 +0900 committer madapaja <iwasaki@cresc.com> 1313731598 +0900 my first commit
  15. 15. $ git tag stable-1
  16. 16. checkout
  17. 17. checkout
  18. 18. checkout add
  19. 19. checkout add commit
  20. 20. checkout add
  21. 21. checkout add
  22. 22. checkout add commit
  23. 23. checkout add commit
  24. 24. checkout add
  25. 25. checkout add
  26. 26. checkout add add
  27. 27. checkout add add commit
  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 HEAD git add -u && git commit $ git commit -a
  42. 42. $ git diff HEAD git add -u && git commit $ git commit -a $ git revert a5102ef4
  43. 43. $ git diff HEAD git add -u && git commit $ git commit -a $ git revert a5102ef4 $ git reset --hard HEAD^
  44. 44. $ git checkout master
  45. 45. $ git checkout master git branch branch1 && git checkout branch1 $ git checkout -b branch1
  46. 46. $ git checkout master git 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

×