【发布时间】:2017-12-13 16:23:19
【问题描述】:
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working tree clean
$ git pull
remote: Counting objects: Z746
git status in master 告诉我我的工作树是干净的,并且我的分支是最新的与原点 (origin/master)。但是,当我git pull 时,它会拉下一大堆我还没有的新代码。
$ git status
On branch development
Your branch is behind 'origin/development' by 243 commits, and can be fast-forwarded.
(use "git pull" to update your local branch)
nothing to commit, working tree clean
$
development 分支上的git status 告诉我我的工作树是干净的,但我的分支位于原点 (origin/development) 后面。所以我 git pull 它拉下了一大堆我还没有的新代码。
我的问题是:为什么同一命令 git status 有时会告诉我需要提取代码,而有时却不需要?
和我所在的分支有关吗?换分支?什么?
【问题讨论】:
-
直到你
pull(或fetch),它只知道自从你上次与origin/master同步以来本地发生了什么变化。 -
在
git status之前运行git fetch -
请不要发帖screenshots of text。将其直接粘贴到您的问题中。
标签: git