44
43

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 5 years have passed since last update.

gitでハッシュ値を取得

Posted at

以下のようにするとHEADのハッシュ値が得られる

$ git rev-parse HEAD
b5b862f5072d516a86e7c469bb015898e7cc631b

ユースケースとしてはスクリプトなどでgitのコミットのリビジョンを比べながら何かしたい時に使える

sha = `git rev-parse HEAD`

参考:StackOverflow(How to retrieve the hash for the current commit in Git?)

44
43
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
44
43

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?