2
3

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で差分ファイルを抽出する

2
Posted at

HEADから一つ前のコミットの差分を抽出する場合はこんな感じ。(ファイル名「archive.zip」で保存)

git archive HEAD `git diff --name-only HEAD HEAD~1` -o archive.zip

余談ですが、zip形式やtar形式の中身チェックは下記コマンドでできるみたい。

zipinfo archive.zip
tar tvf archive.tar

■参考サイト
http://rfs.jp/server/git/gite-lab/git-archive.html

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?