我有一个普通的存储库,其中有一个工作树和一个与工作树位于同一目录中的 .git 文件夹。
我正在尝试使用以下命令从该位置外部运行 git 命令
git --git-dir=/path/to/repo/.git --work-tree=/path/to/repo pull /some/other/repo master
但我不断收到错误fatal: /usr/libexec/git-core/git-pull cannot be used without a working tree.
.
我究竟做错了什么?
这是早期版本的 Git 中的一个错误。一旦升级到 1.7.7.2 或更高版本,此问题就会消失。
From 修复了错误的提交 http://git.kernel.org/?p=git/git.git;a=commit;h=035b5bf6431dbf8f3cde2f44b0d7ef893b95b605:
You can't currently run git-pull or git-rebase from outside
of the work tree, even with GIT_WORK_TREE set, due to an
overeager require_work_tree function. Commit e2eb527
documents this problem and provides the infrastructure for a
fix, but left it to later commits to audit and update
individual scripts.
也可以看看提交 e2eb527 http://git.kernel.org/?p=git/git.git;a=commit;h=e2eb527345d48881dac0d88e6bdfc0a267a2eb62.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)