LoginSignup
2
1

More than 5 years have passed since last update.

リポジトリの一番初めのコミットを取得する

Posted at

リポジトリの最初のコミット

最新のコミットはHEADだが、一番初めのコミットを得るには --max-parents=0オプションを付けてrev-listやlogを呼び出す。
--max-parentsオプションは、親コミットの数を指定することになるので、--max-parents=0は親のないコミット、始祖コミットを取得することが出来る。

Electronのリポジトリで git rev-list --max-parents=0 HEADをするとこうなる
image

git log --max-parents=0を行っても良い

image

環境

git version 2.11.0

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1