Open5
Gitで複数のルートコミットをもつリポジトリをつくる
ピン留めされたアイテム
ピン留めされたアイテム
ほしいグラフ構造
手順
$ git -c init.defaultBranch=primary init
Initialized empty Git repository in /private/var/folders/8r/ffkwjbmd3vsfs722cqtd8s0w0000gn/T/tmp.asu2Ms0K/.git/
$ git commit --all --allow-empty --allow-empty-message --message ""
[primary (root-commit) 493a111]
$ git switch --orphan=secondary
Switched to a new branch 'secondary'
$ git commit --all --allow-empty --allow-empty-message --message ""
[secondary (root-commit) 50aebfe]
$ git switch --orphan=tertiary
Switched to a new branch 'tertiary'
$ git commit --all --allow-empty --allow-empty-message --message ""
[tertiary (root-commit) 0712097]
確認
$ git rev-list --max-parents=0 --all
07120975c7f893cef7c3e3fa217b0748d52dd6dd
50aebfe7885d8e0477e1cb62ea7a655b7591aa09
493a11181f346d87854767c79bf32d728f949bff
$ git -P log --graph --branches --remotes --oneline
* 0712097 (HEAD -> tertiary)
* 50aebfe (secondary)
* 493a111 (primary)
$ git -P reflog --all
0712097 (HEAD -> tertiary) refs/heads/tertiary@{0}: commit (initial):
0712097 (HEAD -> tertiary) HEAD@{0}: commit (initial):
50aebfe (secondary) refs/heads/secondary@{0}: commit (initial):
50aebfe (secondary) HEAD@{1}: commit (initial):
493a111 (primary) refs/heads/primary@{0}: commit (initial):
493a111 (primary) HEAD@{2}: commit (initial):