如何让git从分支而不是标签中拉出?

Qiu*_*ang 9 git git-pull

我们的 repo 恰好有一个与分支名称同名的标签。因此,当我尝试从该分支中​​拉取时,git 感到困惑并从标记中拉出,就像这样。我必须先删除那个标签才能让我的 git pull 工作。

那么我如何告诉 git pull from branch 而不是 tag 呢?

cc-backend ? git pull origin 0.9.0-rc6-patch1                                       
From 10.0.0.28:webcc/cc-backend
 * tag                 0.9.0-rc6-patch1 -> FETCH_HEAD
Already up to date.

/* I have to delete that tag and git pull again to get the result I want */

cc-backend ? git pull origin 0.9.0-rc6-patch1                                       
From 10.0.0.28:webcc/cc-backend
 * branch              0.9.0-rc6-patch1 -> FETCH_HEAD
Updating 9d7e9dc3..2bf3f96a
Fast-forward
 app/Services/GroupSeat/Seat.php | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
Run Code Online (Sandbox Code Playgroud)

Elp*_*Kay 11

似乎远程存储库有一个标签和一个同名的分支0.9.0-rc6-patch1。使用全名来获取/拉取,

# fetch/pull the tag
git fetch/pull origin refs/tags/0.9.0-rc6-patch1

# fetch/pull the branch
git fetch/pull origin refs/heads/0.9.0-rc6-patch1
Run Code Online (Sandbox Code Playgroud)