Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用する利点は何ですか
git archive master/foo | tar -x -C ~/destination
/ fooの コピーをデプロイするのではなく、作業コピーからコピーするだけです。
cp foo ~/destination/foo
したがって、何らかの理由でマスター内のそのサブディレクトリfoo(またはたまたま作業しているブランチ)からすべてをコピーしたくない場合を除いて、[destination]にデプロイするためにcpを使用するだけで十分です。
git archivegitリポジトリの一部であるアイテムのみをエクスポートします。 ディレクトリ、gitによって無視されるファイルcpなど、指定されたディレクトリの下にあるすべてのものをコピーします。.git
git archive
cp
.git