3
1

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で特定のブランチとの差分ソースをZipで出力する。

Last updated at Posted at 2018-01-22

Gitで親ブランチとの差分ソースをZipで出力する。

リリース時などに使うやつ。:writing_hand:(.. )メモメモ
比較ブランチがdevelopの場合のコマンドです。適宜変更してください。

git archive --format=zip --prefix=root/ HEAD `git diff --name-only MyBranch` -o archive.zip

20200330 追記 :pencil:

上記コマンドだと、削除コミットなどがあった場合にファイルがないというエラーが発生するので、以下のほうがベネです。

git archive --format=zip HEAD `git diff develop --name-only --diff-filter=AM` -o archive.zip

--diff-filterでA(Add) と M(Modify)にフィルタしています。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?