开发者

git-archive vs. cp

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜