LoginSignup
12
5

More than 5 years have passed since last update.

submoduleまで含めてgitリポジトリの内容をzipファイルにする

Posted at

gitのソースコードをzipで圧縮したいとする。その際、git cloneしたものをzipすると.gitディレクトリが入ってしまったりする。
その際に便利に使えるコマンドがgit archiveである。こちらの記事がわかりやすいので参照していただきたい。
Git リポジトリの内容を zip ファイルにする

リポジトリにサブモジュールが含まれない場合はこれで問題ないのだが、submoduleまで含めて再帰的にarchiveしたい場合はどうすれば良いか?
こちらのStackOverflowの記事に非常に簡単な手法が紹介されていた。
https://github.com/Kentzo/git-archive-all を使う。

$ pip install git-archive-all
$ git-archive-all my_repo.zip        # my_repo.zipファイルが作られる
12
5
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
12
5