开发者

git-archive vs. cp

开发者 https://www.devze.com 2023-01-22 07:53 出处:网络
What is the advantage of using git archive master/foo | tar -x -C ~/destination to deploy a copy of /foo vs. just copying from the the working copy with

What is the advantage of using

git archive master/foo | tar -x -C ~/destination

to deploy a copy of /foo vs. just copying from the the working copy with

cp foo ~/destination/foo

So, unless for some reaso开发者_如何学运维n you don't want to copy everything over from that sub directory foo in master (or whatever branch you happening to be working on), using cp for deploying to a [destination] would suffice.


git archive only exports items that are part of the git repository. cp copies everything that's under the specified directory, including the .git directory, files which are ignored by git, etc.

0

精彩评论

暂无评论...
验证码 换一张
取 消