yashinomi / sysdev2020_advanced

0 stars 0 forks source link

Class 3. Exercise 8. log #13

Closed yashinomi closed 3 years ago

yashinomi commented 3 years ago

コミット順とコミットメッセージの修正

yashinomi commented 3 years ago

masterに戻ってマージ。

$ git checkout master
Switched to branch 'master'
$ git merge br-b
Updating 5894ba3..e5729f1
Fast-forward
 fuga.txt | 1 +
 hoge.txt | 1 +
 2 files changed, 2 insertions(+)
yashinomi commented 3 years ago

git reflogを見る。

e5729f1 (HEAD -> master, br-b) HEAD@{0}: merge br-b: Fast-forward
e5729f1 (HEAD -> master, br-b) HEAD@{0}: merge br-b: Fast-forward
5894ba3 HEAD@{1}: checkout: moving from br-b to master
e5729f1 (HEAD -> master, br-b) HEAD@{2}: rebase (finish): returning to refs/heads/br-b
e5729f1 (HEAD -> master, br-b) HEAD@{3}: commit: fix conlict
9423a7b HEAD@{4}: rebase (pick): add more hoge
5894ba3 HEAD@{5}: rebase (start): checkout master
28ef841 HEAD@{6}: checkout: moving from master to br-b
5894ba3 HEAD@{7}: commit: add more fugafuga
c7a420a HEAD@{8}: checkout: moving from br-b to master
28ef841 HEAD@{9}: commit: add more fuga
0cf623e HEAD@{10}: commit: add more hoge
c7a420a HEAD@{11}: checkout: moving from master to br-b
c7a420a HEAD@{12}: commit (merge): fix conflict
yashinomi commented 3 years ago

コミット順変更前

$ git log --graph --all --decorate=full 
* commit e5729f102423ba7e702cbf7c6c563508bcb8c1b7 (HEAD -> refs/heads/master, refs/heads/br-b)
| Author: 
| Date:   Fri Oct 23 16:29:36 2020 +0900
| 
|     fix conlict
| 
* commit 9423a7b3a7d6997532c43b823d58c168786cc823
| Author: 
| Date:   Fri Oct 23 16:21:39 2020 +0900
| 
|     add more hoge
| 
* commit 5894ba3f27a62ab4cbb6660be2e54a77a7b561f6
| Author: 
| Date:   Fri Oct 23 16:25:36 2020 +0900
| 
|     add more fugafuga
|   
*   commit c7a420abe4b3d34b829d755c4c18b34cefc60783
|\  Merge: bd26177 9e6d64d
| | Author: 
| | Date:   Fri Oct 23 16:08:39 2020 +0900
| | 
| |     fix conflict
yashinomi commented 3 years ago

コミット順変更

$ git rebase -i c7a420abe4b3d34b829d755c4c18b34cefc60783
Successfully rebased and updated refs/heads/master.
yashinomi commented 3 years ago

コミット順変更後

$ git log --graph --all --decorate=full
* commit 946e3a097320d95ca90b89f4e563612e6f3022fe (HEAD -> refs/heads/master)
| Author:
| Date:   Fri Oct 23 16:29:36 2020 +0900
| 
|     fix conlict
| 
* commit d8391f87172026e3ade9506ad30f4cdf781c9f12
| Author:
| Date:   Fri Oct 23 16:25:36 2020 +0900
| 
|     add more fugafuga
| 
* commit 98e14793d011d9a0568fb2093debfe40b8b09a44
| Author:
| Date:   Fri Oct 23 16:21:39 2020 +0900
| 
|     add more hoge
|   
| * commit e5729f102423ba7e702cbf7c6c563508bcb8c1b7 (refs/heads/br-b)
| | Author:
| | Date:   Fri Oct 23 16:29:36 2020 +0900
| | 
| |     fix conlict
yashinomi commented 3 years ago

コミットのスペルミスを修正。conlict を conflict に。

$ git commit --amend

結果の確認

$ git log --graph --all --decorate=full                                                 [09:00:23]
* commit 23e42c896aadc3f65753e65c67d884f7791488a4 (HEAD -> refs/heads/master)
| Author: 
| Date:   Fri Oct 23 16:29:36 2020 +0900
| 
|     fix conflict
| 
* commit d8391f87172026e3ade9506ad30f4cdf781c9f12
| Author:
| Date:   Fri Oct 23 16:25:36 2020 +0900
| 
|     add more fugafuga
| 
* commit 98e14793d011d9a0568fb2093debfe40b8b09a44
| Author:
| Date:   Fri Oct 23 16:21:39 2020 +0900
| 
|     add more hoge
|   
| * commit e5729f102423ba7e702cbf7c6c563508bcb8c1b7 (refs/heads/br-b)
| | Author: 
| | Date:   Fri Oct 23 16:29:36 2020 +0900
| | 
| |     fix conlict