LoginSignup
2
3

More than 5 years have passed since last update.

git diff とか format-patch で特定コミットとその直前コミットを指定する

Last updated at Posted at 2016-08-10

直前 commit との diff

$ git diff #{commit_hash}^..#{commit_hash}

5 個前の commit との format-patch

$ git format-patch #{commit_hash}~5..#{commit_hash} -o/tmp/patch

HEAD^ で最新の一個前が、HEAD~5 で最新の 5 個前が指定できることは知っていましたが、
HEAD の部分がコミットハッシュでも良いと今知りました。

2
3
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
3