20. 変更がstageに乗ってない
$ git status
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: README.md
#
no changes added to commit (use "git add" and/or "git commit -a")
37. stashに退避していた
変更を戻す
$ git stash pop
Auto-merging README.md
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: README.md
#
no changes added to commit (use "git add" and/or "git commit -a")
Dropped refs/stash@{0} (f8b03350e0885238db913343722e5c345ea4aeb7)
$ cat README.md
Hello, world!
foo
Git, a cool SCM
now thinking.....
48. マージする
$ git checkout master
$ git merge RB-1
Auto-merging README.md
CONFLICT (content): Merge conflict in README.md
Automatic merge failed; fix conflicts and then commit the result.
CONFLICT(競合)しちゃった
49. 競合の確認
CONFLICT(競合)しちゃった
$ git status
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#
# Unmerged paths:
# (use "git add/rm <file>..." as appropriate to mark resolution)
#
# both modified: README.md
#
no changes added to commit (use "git add" and/or "git commit -a")
50. 競合を確認する
$ cat README.md
Hello, world!
foo
Git, a cool SCM
now thinking.....
extra line
<<<<<<< HEAD
bar
=======
BAZ
>>>>>>> RB-1
同じ位置(最終行)に違う変更を入れたため競合が
発生しました
52. 競合の修正を確認
$ git diff
diff --cc README.md
index fb2ada9,275ac2a..0000000
--- a/README.md
+++ b/README.md
@@@ -3,4 -3,4 +3,8 @@@ fo
Git, a cool SCM
now thinking.....
extra line
- bar
-BAZ
++bar and BAZ
54. 競合の修正をcommit
$ git commit
-m オプションを指定しないとエディタによるコメン
ト入力が求められますが、デフォルトはこんな感じ
Merge branch 'RB-1'
Conflicts:
README.md
#
# It looks like you may be committing a MERGE.
# If this is not correct, please remove the file
# .git/MERGE_HEAD
# and try again.
#
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#
# Changes to be committed:
#
# modified: README.md
#
106. A successful Git branching
model
A successful Git branching model を翻訳しました
http://keijinsonyaban.blogspot.com/2010/10/successful-git-branching-
model.html
A successful Git branching model を補助する git-
flow を使ってみた
http://d.hatena.ne.jp/Voluntas/20101223/1293111549