git-archive vs. cp

南笙酒味 提交于 2019-12-02 02:17:29

问题


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 reason 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.


回答1:


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.



来源:https://stackoverflow.com/questions/4051803/git-archive-vs-cp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!