git checkout 分支名 报错? fatal: 'ssr' could be both a local file and a tracking branch. 如何解决?
# git checkout ssr
fatal: 'ssr' could be both a local file and a tracking branch.
Please use -- (and optionally --no-guess) to disambiguate
是否用 git checkout origin/ssr
?, 并不赞成. 因为这是一个远程分支.
那么怎么办呢? 答: 用 switch
如下,
git switch ssr
结果:
On branch ssr
Your branch is up to date with 'origin/ssr'.
nothing to commit, working tree clean
观察结果, 可以看到成功切换到了 ssr 分支, 可以再用 git status
或 git branch
确认一下.