我在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.
Run Code Online (Sandbox Code Playgroud)
但是,如果一位同事做同样的事情,他会一遍又一遍地留下同样的信息,而不会得到"已经是最新的"
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.
Run Code Online (Sandbox Code Playgroud)
为什么会这样呢?
更新:
我尝试了建议的答案,看不出任何问题.但似乎问题是我们使用不同的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
Run Code Online (Sandbox Code Playgroud)
看看你的同事.git/config,看来git不知道远程分支origin/master需要合并到他的本地master分支.
你应该有这样的配置
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = ...
[branch "master"]
remote = origin
merge = refs/heads/master
Run Code Online (Sandbox Code Playgroud)
注意,git pull做一个git fetch,然后一个git merge引擎盖.您可以分步尝试看看出了什么问题.
git checkout master
git fetch origin
git merge origin/master
Run Code Online (Sandbox Code Playgroud)