0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

コマンドラインから、git logで見れる最新commitのハッシュを取得する

Posted at

git logで以下のようなログが表示されることを前提としたとき、

$ git log
commit 1413718bb40c9a1ebd4ffe037f934076df4c70eb (HEAD -> master, origin/master, origin/HEAD)
...

以下のようにして最新commitのハッシュを取得する

$ git log | head -1 | cut -d' ' -f 2
1413718bb40c9a1ebd4ffe037f934076df4c70eb

備考

何かもっと良い方法があるような気もする

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?