Я просмотрел другие вопросы по аналогичному вопросу.Как получить всю удаленную ветку, «git fetch -all» не работает
Но они, кажется, говорят, что ответ 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
Из вашего редактирования, похоже, что он работает. В чем проблема? – noahnu
@noahnu Я думаю, что 'git branch' должен показать' branch A', а также 'master'. – SangminKim