下記はdevelopブランチの
git log --graph --decorate=full
ですが、
例えば、
19e04e44dd4cb50a33abe742ea546ab9f1bbfe0a
を指定して、これでマージされたブランチに含まれるコミット
a494a16f23e193f51bf162caec90770d8e754985
2fe6bf0277aacc12020193494a960d9b4ebd1d05
4bfeb875bfd73e902041d4c2c17888e8392ae8fe
876afd4cf04ae1dbc206e857a328316b883df7c7
だけを抽出するにはどうすればよいでしょうか?
このブランチが更に枝分かれしていたとすると、枝分かれ先のコミットも含めて抽出したいです。
また、このとき、マージのコミット
(つまり例えば
514b9eb4a88f789be1c8a3de5e312c540ecf8929
みたいなコミット)は除きたいです。
git log --cherryなど調べましたが、うまく行きませんでした。
* commit b037c787beec4fa02b8c5e1a149f9cceb69ed321 (HEAD -> refs/heads/develop, refs/remotes/origin/develop, refs/remotes/origin/HEAD) |\ Merge: 31d2710 f1fa2e3 | | Author: xxx-xxxx <+xxx-xxxx@users.noreply.github.com> | | Date: Thu Mar 4 09:59:43 2021 +0900 | | | | Merge pull request #9 from xxx-xxxx/C | | | | h.txt line2 added. | | | * commit f1fa2e36846be086d7c3b6bfd71b4cbf29faf959 | | Author: X.Xxxxxxxx <x-xxxx@xxxx.xxx.ne.jp> | | Date: Thu Mar 4 09:58:31 2021 +0900 | | | | h.txt line2 added. | | * | commit 31d27103d9281fa9bbca2b79cb80db1ba36ab498 |\ \ Merge: 19e04e4 ff13434 | | | Author: xxx-xxxx <+xxx-xxxx@users.noreply.github.com> | | | Date: Thu Mar 4 09:52:02 2021 +0900 | | | | | | Merge pull request #8 from xxx-xxxx/A | | | | | | A | | | | * | commit ff13434d4380ce6862e1e62925af104783107030 | | | Author: X.Xxxxxxxx <x-xxxx@xxxx.xxx.ne.jp> | | | Date: Thu Mar 4 09:50:50 2021 +0900 | | | | | | b.txt line2 added. | | | | * | commit a064002a7c908a67f775c7d2fea723ab66077cd6 |/ / Author: X.Xxxxxxxx <x-xxxx@xxxx.xxx.ne.jp> | | Date: Thu Mar 4 09:50:21 2021 +0900 | | | | a.txt line3 added. | | * | commit 19e04e44dd4cb50a33abe742ea546ab9f1bbfe0a |\ \ Merge: 514b9eb a494a16 | |/ Author: xxx-xxxx <+xxx-xxxx@users.noreply.github.com> |/| Date: Thu Mar 4 09:45:59 2021 +0900 | | | | Merge pull request #7 from xxx-xxxx/B | | | | B | | | * commit a494a16f23e193f51bf162caec90770d8e754985 | | Author: X.Xxxxxxxx <x-xxxx@xxxx.xxx.ne.jp> | | Date: Thu Mar 4 09:44:36 2021 +0900 | | | | e.txt line1 added. | | | * commit 2fe6bf0277aacc12020193494a960d9b4ebd1d05 | | Author: X.Xxxxxxxx <x-xxxx@xxxx.xxx.ne.jp> | | Date: Thu Mar 4 09:44:11 2021 +0900 | | | | d.txt line1 added. | | | * commit 4bfeb875bfd73e902041d4c2c17888e8392ae8fe | | Author: X.Xxxxxxxx <x-xxxx@xxxx.xxx.ne.jp> | | Date: Thu Mar 4 09:43:45 2021 +0900 | | | | f.txt added. | | | * commit 876afd4cf04ae1dbc206e857a328316b883df7c7 | | Author: X.Xxxxxxxx <x-xxxx@xxxx.xxx.ne.jp> | | Date: Thu Mar 4 09:43:23 2021 +0900 | | | | e.txt added. | | * | commit 514b9eb4a88f789be1c8a3de5e312c540ecf8929 |\ \ Merge: 386993b 49d5ee6 | |/ Author: xxx-xxxx <+xxx-xxxx@users.noreply.github.com> |/| Date: Thu Mar 4 09:37:58 2021 +0900 | | | | Merge pull request #6 from xxx-xxxx/A | | | | a.txt line2 added. | | | * commit 49d5ee660c32bb275df672b33d309e2c1c17a70a |/ Author: X.Xxxxxxxx <x-xxxx@xxxx.xxx.ne.jp> | Date: Thu Mar 4 09:30:50 2021 +0900 | | a.txt line2 added. | * commit 386993bf9ace6b4dec1e55bde868f865b7c81d20 |\ Merge: 4a4ebf5 3347596 | | Author: xxx-xxxx <+xxx-xxxx@users.noreply.github.com> | | Date: Thu Mar 4 09:22:52 2021 +0900 | | | | Merge pull request #5 from xxx-xxxx/A | | | | c.txt line1 added. | | | * commit 33475968cbf8c073d16a1c6d41eca550431b2d43 | | Author: X.Xxxxxxxx <x-xxxx@xxxx.xxx.ne.jp> | | Date: Thu Mar 4 09:21:39 2021 +0900 | | | | c.txt line1 added. | | * | commit 4a4ebf59885e255e5be5f562d326836bd7cbe5e4 |\ \ Merge: cb47f5e c7772e1 | | | Author: xxx-xxxx <+xxx-xxxx@users.noreply.github.com> | | | Date: Thu Mar 4 09:03:04 2021 +0900 | | | | | | Merge pull request #4 from xxx-xxxx/C | | | | | | C | | | | * | commit c7772e1810615d630ed1a452cdf27e32ea2bc555 | | | Author: X.Xxxxxxxx <x-xxxx@xxxx.xxx.ne.jp> | | | Date: Thu Mar 4 09:01:30 2021 +0900 | | | | | | i.txt line1 added. | | | | * | commit b74dc19fd01c152e5766c7d03377f55a2c8a08eb | | | Author: X.Xxxxxxxx <x-xxxx@xxxx.xxx.ne.jp> | | | Date: Thu Mar 4 09:00:58 2021 +0900 | | | | | | i.txt added. | | | | * | commit de82a1d17c13a3e9bd90997f8edaee034c6e108e | | | Author: X.Xxxxxxxx <x-xxxx@xxxx.xxx.ne.jp> | | | Date: Thu Mar 4 09:00:31 2021 +0900 | | | | | | h.txt line1 added. | | | | * | commit d156a41d18a31b2860420f1abb9d2353520f0dc2 | | | Author: X.Xxxxxxxx <x-xxxx@xxxx.xxx.ne.jp> | | | Date: Thu Mar 4 08:59:56 2021 +0900 | | | | | | h.txt added. | | | * | | commit cb47f5e375414317c536dccf461faba335185236 |\ \ \ Merge: 4031223 584a89e | |_|/ Author: xxx-xxxx <+xxx-xxxx@users.noreply.github.com> |/| | Date: Thu Mar 4 08:57:12 2021 +0900 | | | | | | Merge pull request #3 from xxx-xxxx/B | | | | | | b.txt added. | | | | * | commit 584a89e134bbce450acb4cf44c1f356d879e92dc | |/ Author: X.Xxxxxxxx <x-xxxx@xxxx.xxx.ne.jp> | | Date: Thu Mar 4 08:55:05 2021 +0900 | | | | b.txt added. | | * | commit 40312231530e3671d7805635ce0d5788944940d9 |\ \ Merge: 22b11d4 db50ad7 | |/ Author: xxx-xxxx <+xxx-xxxx@users.noreply.github.com> |/| Date: Wed Mar 3 22:38:57 2021 +0900 | | | | Merge pull request #2 from xxx-xxxx/A | | | | A | | | * commit db50ad7abe80bdfdab8111a18ceac88384619d18 | | Author: X.Xxxxxxxx <x-xxxx@xxxx.xxx.ne.jp> | | Date: Wed Mar 3 22:36:06 2021 +0900 | | | | c.txt added. | | | * commit 65ec3b145f48047ce7bd8433969522ce37c4ba37 | | Author: X.Xxxxxxxx <x-xxxx@xxxx.xxx.ne.jp> | | Date: Wed Mar 3 22:35:22 2021 +0900 | | | | b.txt line1 added. | | | * commit 9997cf816b8627fd0f1a250145249321ab002350 |/ Author: X.Xxxxxxxx <x-xxxx@xxxx.xxx.ne.jp> | Date: Wed Mar 3 22:34:50 2021 +0900 | | a.txt line1 added. | * commit 22b11d4e6048c3f02ff0604d7966b329e9e43388 |\ Merge: 6af478c 14f256b | | Author: xxx-xxxx <+xxx-xxxx@users.noreply.github.com> | | Date: Wed Dec 2 22:43:58 2020 +0900 | | | | Merge pull request #1 from xxx-xxxx/feature-A | | | | Feature a | | | * commit 14f256b4569321e46dd200fd1e0b02c926cf7f1b | | Author: X.Xxxxxxxx <x-xxxx@xxxx.xxx.ne.jp> | | Date: Wed Dec 2 22:36:01 2020 +0900 | | | | b.txt added. | | | * commit b46e1158c730e8fa6ab041070699b8ca502d8139 |/ Author: X.Xxxxxxxx <x-xxxx@xxxx.xxx.ne.jp> | Date: Wed Dec 2 22:35:34 2020 +0900 | | a.txt added. | * commit 6af478cb0c7681d5071f3018ae92e9e0f40638bf (refs/remotes/origin/main) Author: xxx-xxxx <+xxx-xxxx@users.noreply.github.com> Date: Wed Dec 2 22:18:28 2020 +0900 Initial commit
git log --graph --oneline などのコマンドで履歴をもっと見やすい形で示してください。
すみません。以下になります。
* b037c78 Merge pull request #9 from xxx-xxxx/C
|\
| * f1fa2e3 h.txt line2 added.
* | 31d2710 Merge pull request #8 from xxx-xxxx/A
|\ \
| * | ff13434 b.txt line2 added.
| * | a064002 a.txt line3 added.
|/ /
* | 19e04e4 Merge pull request #7 from xxx-xxxx/B
|\ \
| |/
|/|
| * a494a16 e.txt line1 added.
| * 2fe6bf0 d.txt line1 added.
| * 4bfeb87 f.txt added.
| * 876afd4 e.txt added.
* | 514b9eb Merge pull request #6 from xxx-xxxx/A
|\ \
| |/
|/|
| * 49d5ee6 a.txt line2 added.
|/
* 386993b Merge pull request #5 from xxx-xxxx/A
|\
| * 3347596 c.txt line1 added.
* | 4a4ebf5 Merge pull request #4 from xxx-xxxx/C
|\ \
| * | c7772e1 i.txt line1 added.
| * | b74dc19 i.txt added.
| * | de82a1d h.txt line1 added.
| * | d156a41 h.txt added.
* | | cb47f5e Merge pull request #3 from xxx-xxxx/B
|\ \ \
| |_|/
|/| |
| * | 584a89e b.txt added.
| |/
* | 4031223 Merge pull request #2 from xxx-xxxx/A
|\ \
| |/
|/|
| * db50ad7 c.txt added.
| * 65ec3b1 b.txt line1 added.
| * 9997cf8 a.txt line1 added.
|/
* 22b11d4 Merge pull request #1 from xxx-xxxx/feature-A
|\
| * 14f256b b.txt added.
| * b46e115 a.txt added.
|/
* 6af478c Initial commit
回答1件
あなたの回答
tips
プレビュー