Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
1
Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

@Yinaura

Git | 現在のコミットハッシュを得るエイリアス

解決

専用コマンドがあるようだ。コメント欄を参照のこと。

最初の解決

エイリアスを作っておけば。
$ git revision と打つだけで、簡単にコミットハッシュを得られる。

.gitconfig
[alias]
  revision = !git show -s --format=%H

例:

$ git revision
55176575a31a65118760c30e64cde839e9bb20a3

応用

HEAD を指定すれば、過去のコミットハッシュを得るのも簡単だ。

$ git revision HEAD^

$ git revision HEAD^^

環境

  • git version 2.3.8 (Apple Git-58)

参考

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
1
Help us understand the problem. What are the problem?