【发布时间】:2015-10-05 08:42:46
【问题描述】:
我已经查看了有关类似问题的其他问题。
但他们似乎说答案是git fetch --all。
但在我的情况下,它不起作用。
这就是我为它所做的。
> git branch
* master
> git branch -r
origin/master
origin/A
> git fetch --all
> git branch
* master #still not updated
> git fetch origin/A
fatal: 'origin/A' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
> git fetch remotes/origin/A
fatal: 'origin/A' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
我也试过git pull --all,但结果是一样的。
-------------------编辑-------
> git pull --all
Already up-to-date.
> git branch
* master # I think it should show branch A also
> git remote show origin
HEAD branch: master
Remote branches:
A tracked
master tracked
-------------------编辑-------
> git pull origin A
* branch A -> FETCH_HEAD
Already up-to-date.
> git branch
* master # I think it should show barnch A also
【问题讨论】:
-
1.这是
git fetch origin A不是git fetch origin/A。 2.git pull将执行fetch和merge。git pull --all应该对所有跟踪的分支执行拉取操作。 -
从您的编辑看来,它正在工作。有什么问题?
-
@noahnu 我认为
git branch应该显示branch A以及master。
标签: git version-control fetch