【发布时间】:2012-04-02 12:11:47
【问题描述】:
我有一个正常的仓库,其中有一个工作树和一个与工作树在同一目录中的 .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?
-
就像这样:所有文件(工作树)都在某个文件夹中,例如
/some/repo,并且在这个文件夹中也是一个.git 文件夹/some/repo/.git。我通常会从/some/repo内部运行 git 命令。我有版本1.7.2.3。
标签: git git-push git-pull git-commit