gpt4 book ai didi

git - Pathspec upstream/master 不明确

转载 作者:太空狗 更新时间:2023-10-29 14:15:41 24 4
gpt4 key购买 nike

我可以推送、 pull 和检查上游/master 一点问题都没有,但我确实收到警告。Upstream/master 用于跟踪对我 fork 的原始源代码所做的更改(已遵循 github 说明)。

例如

$ git checkout upstream/master
warning: refname upstream/master is ambiguous

$ git branch -a
* master
upstream/master
remotes/origin/HEAD -> origin/master
remotes/origin/master
remotes/upstream/master

这个命令也有不明确的错误:

$ git branch
* master
upstream/master

$ git checkout upstream/master filename.bar

最佳答案

This page提到了此类消息的常见原因:

When you try to checkout a local branch, you get a

warning: refname 'branch-name' is ambiguous

This can happen if you've created a local branch with the same name as a remote tag.
Git should be checking out your local branch, but instead it's trying to checkout the tag, and it gets confused.

In general, when creating tags, be careful not to have names that conflict with existing (local or remote) branches.

关于git - Pathspec upstream/master 不明确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10633332/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com