【发布时间】:2019-10-04 06:09:07
【问题描述】:
我有这个:
git clone --depth=1 <repo> app
cd app
git fetch origin
git checkout a119b1076dd45a88a3609c4f7893ef3d82f9a4ee
但它说:
fatal: reference is not a tree: a119b1076dd45a88a3609c4f7893ef3d82f9a4ee
如果我使用分支的名称:
git checkout me/work
我明白了:
error: pathspec 'me/work' did not match any file(s) known to git.
是因为我做了一个浅克隆吗?对我没有多大意义。提交在远程,至少具有该名称的分支/提交在远程。
更新:
所以我在git fetch --all 中添加了一个--all,然后运行git branch -vv --all,我看到了:
* master 4761f83 [origin/master] timeline event update date should not be the review date. Every time it is inserted or updated the update date should be the current utc date
remotes/origin/HEAD -> origin/master
remotes/origin/master 4761f83 timeline event update date should not be the review date. Every time it is inserted or updated the update date should be the current utc date
所以分支不在那个列表中,如果这对我有帮助的话。
【问题讨论】:
标签: git git-clone git-checkout