Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个名为 FOO 的远程仓库,它有以下两个修订:
提交1 提交2
我有一个目录'bar',其中包含 commit2 的所有文件,但我缺少 .git 目录和所有元数据。
有没有办法让我只将远程中的 '.git' 元数据“git clone”到我的当前目录中而没有文件?
主要目标是避免浪费时间签出文件,因为我已经有了它们。
有什么建议么 ?提前致谢。
git clone -n
-n 将告诉 git 在执行克隆后不要检查头部。