10

我在 cloufforge 设置了一个新的 Git 存储库,但遇到了一些不寻常的问题。

When I do a git pull origin master

From https://dndigital.git.cloudforge.com/project
 * branch            master     -> FETCH_HEAD
Already up-to-date.

但是,如果一位同事也这样做,他会一遍又一遍地收到相同的信息,而没有得到“已经是最新的”

remote: Counting objects: 85, done.
remote: Compressing objects: 100% (58/58), done.
remote: Total 76 (delta 59), reused 19 (delta 13)
Unpacking objects: 100% (76/76), done.
From https://dndigital.git.cloudforge.com/project
 * branch            master     -> FETCH_HEAD
There are no candidates for merging among the refs that you just fetched.
Generally this means that you provided a wildcard refspec which had no
matches on the remote end.

请问为什么会这样?

更新:

我尝试了建议的答案,但看不到任何问题。但似乎问题在于我们使用不同的 git 客户端。拥有不同版本的 Git 客户端似乎会成为问题。那真的很复杂。有没有办法将 Git 的功能限制在某个 git 版本,让最早的 Git 客户端仍然可以工作?

[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
[remote "origin"]
    fetch = +refs/heads/*:refs/remotes/origin/*
    url = https://username@dndigital.git.cloudforge.com/project.git
[branch "master"]
    remote = origin
    merge = refs/heads/master
[user]
    name = 
    email = 
[giggle]
    file-view-path = agile/includes/SiteConfig.php
[gui]
    wmstate = zoomed
    geometry = 787x379+512+242 248 420
4

2 回答 2

11

嘿,我刚刚遇到了同样的问题,但这是由于目标文件夹空间不足引起的。如果没有其他方法,可能有助于检查。

于 2014-04-15T07:57:15.673 回答
8

看看你同事的.git/config,好像git不知道远程分支origin/master需要合并到他的本地master分支中。

你应该有这样的配置

[remote "origin"]
    fetch = +refs/heads/*:refs/remotes/origin/*
    url = ...
[branch "master"]
    remote = origin
    merge = refs/heads/master

请注意,在引擎盖下git pull执行 a git fetch,然后执行 a 。git merge您可以分步尝试,看看出了什么问题。

git checkout master
git fetch origin
git merge origin/master
于 2012-12-10T11:46:59.010 回答