如何在没有.git目录和.gitignore文件的情况下直接从远程服务器复制git存储库?提前从标签名称或分支.
Ser*_* K. 14
您可以使用该命令
git archive branchname
Run Code Online (Sandbox Code Playgroud)
从命名树中归档文件.即你可以传递输出来tar
打包文件或过滤文件,如.gitignore
(.git
不会被导出):
git archive branchname | tar -x -C c:\git-my-branch
Run Code Online (Sandbox Code Playgroud)
结帐出git help archive
更多的细节.
相当于svn export . otherpath
现有仓库内部的是
git archive branchname | (cd otherpath; tar x)
Run Code Online (Sandbox Code Playgroud)
相当于svn export url otherpath
IS
git archive --remote=url branchname | (cd otherpath; tar x)
Run Code Online (Sandbox Code Playgroud)