我得到这个错误拉:

您的配置指定与ref合并 'refs/heads/feature/Sprint4/ABC-123-Branch',但没有 这样的裁判是拿来的。

这个错误不会出现在任何其他分支上。这个分支的特殊之处在于,它是从另一个分支的上一次提交中创建的。 我的配置文件如下:

[core]
    repositoryformatversion = 0
    filemode = false
    bare = false
    logallrefupdates = true
    symlinks = false
    ignorecase = true
    hideDotFiles = dotGitOnly
[remote "origin"]
    url = <url here>
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
    remote = origin
    merge = refs/heads/master
[branch "new-develop"]
    remote = origin
    merge = refs/heads/new-develop
[branch "feature/Sprint4/ABC-123-Branch"]
    remote = origin
    merge = refs/heads/feature/Sprint4/ABC-123-Branch

当前回答

如果您/某人重命名了分支,也会发生这种情况。 因此,请遵循以下步骤(如果您知道分支名称已重命名) 假设之前的分支名称是错误的分支名称有人将其重命名为正确的分支名称那么。

git checkout correct-branch-name

git pull(你会看到“你的配置指定了..”)

git branch --unset-upstream

git branch --set-upstream-to=origin/correct-branch-name

对于较旧的git版本,git push——set-upstream origin correct-branch-name

Git pull(你不会得到之前的消息)

其他回答

重命名本地分支

Git分支-m temp

显示所有分支

Git分支-a

签出特定的远程分支

Git checkout main

删除临时分支

Git分支-d temp

对我来说,这是一个个案敏感性问题。我的本地分支是Version_feature2而不是Version_feature2。我重新检查了我的分支使用正确的套管,然后git拉工作。

当我在我的根项目中运行'git pull'命令时,出现了以下错误:

命令: git拉

错误: 你的配置指定与ref 'refs/heads/main'合并 从遥控器,但没有这样的裁判。

情况: 我只是删除了。git文件夹,并通过在我的根项目文件夹中运行git init命令重新初始化。git(再次创建。git文件夹),它工作了。

检查您的远程分支是否可用。 我也有同样的问题,最后意识到远程分支被某人删除了。

对我来说,这是因为我合并了一个分支开发到主使用web界面,然后尝试同步/拉使用VSCode在开发分支上打开。(这很奇怪,我不能改变到master没有得到这个错误。)

git pull
Your configuration specifies to merge with the ref 'refs/heads/dev'
from the remote, but no such ref was fetched.'

这是有意义的,没有找到它refs/heads/dev -对我来说,它更容易删除本地文件夹,并再次克隆。