我从 github 克隆了一个带有 2 个分支的仓库:
git clone https://github.com/user/repo
cd repo
当我这样做时git branch
,它只显示主分支。然后我做了一个git branch -a
它显示所有分支。
master
remotes/origin/HEAD
remotes/origin/master
remotes/origin/develop
然后我做了一个git checkout develop
:
Branch develop set up to track remote branch develop from origin.
Switched to a new branch 'develop'
然后git checkout master
回到master
分支。
为什么git checkout develop
不同于git checkout origin/develop
(它说我处于分离的头部状态)?