我收到了一个可以处理的裸 git 存储库——我们称之为bare.git。
我已将其保存到D:/workspace/bare.git并克隆了它
$git clone bare.git bare
一切正常,直到我想推动我的改变。我收到以下 git 错误
$git push
error: failed to push some refs to 'D:/workspace/bare.git'
$git push origin master
error: failed to push some refs to 'D:/workspace/bare.git'
从我的角度来看,一切都已正确设置,但我仍然无法弄清楚为什么我不能推动任何东西。
$git remote show origin
remote origin
Fetch URL: D:/workspace/bare.git
Push URL: D:/workspace/bare.git
HEAD branch: master
Remote branch:
master tracked
Local branch configured for 'git pull':
master merges with remote master
Local ref configured for 'git push':
master pushes to master (up to date)
这是我的 .git/config
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
[remote "origin"]
url = D:/workspace/bare.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
是的 - 裸存储库的主分支中已经有一些提交。
有任何想法吗?