是否进行“ git导出”(如“ svn导出”)?

安稳与你 提交于 2020-08-15 12:45:56

问题:

I've been wondering whether there is a good "git export" solution that creates a copy of a tree without the .git repository directory. 我一直在想是否有一个好的“ git export”解决方案来创建没有.git存储库目录的树的副本。 There are at least three methods I know of: 我至少知道三种方法:

  1. git clone followed by removing the .git repository directory. git clone然后删除.git存储库目录。
  2. git checkout-index alludes to this functionality but starts with "Just read the desired tree into the index..." which I'm not entirely sure how to do. git checkout-index暗示了此功能,但以“只需将所需的树读入索引...”开头,我不确定该怎么做。
  3. git-export is a third party script that essentially does a git clone into a temporary location followed by rsync --exclude='.git' into the final destination. git-export是第三方脚本,其本质上是将git clone到临时位置,然后将rsync --exclude='.git' git clone到最终目标位置。

None of these solutions really strike me as being satisfactory. 这些解决方案都没有使我感到满意。 The closest one to svn export might be option 1, because both those require the target directory to be empty first. 最接近svn export选项可能是选项1,因为这两个选项均要求目标目录首先为空。 But option 2 seems even better, assuming I can figure out what it means to read a tree into the index. 但是,假设我能弄清楚将树读入索引的含义,选项2似乎更好。


解决方案:

参考一: https://stackoom.com/question/fmS/是否进行-git导出-如-svn导出
参考二: https://oldbug.net/q/fmS/Do-a-git-export-like-svn-export
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!