Git commit错误:存储库无效 [英] Git commit ERROR: Repository invalid
问题描述
我创建了一个存储库并成功地进行了初始提交。
我的问题来了,当我试图做另一个提交,这是我得到的消息:
Immanuels-MacBook-亲:octopress manuweg $ git add。
Immanuels-MacBook-Pro:octopress manuweg $ git commit -m更改源URL
[源e0fff54]更改源URL
更改1个文件,1个插入(+),1个删除( - )
Immanuels-MacBook-Pro:octopress manuweg $ git push origin source
错误:存储库无效。
fatal:远程端意外挂起
这是我的.git /配置文件
[remoteorigin]
url = git@github.com:manuweg / manuweg.github。 com.git
fetch = + refs / heads / *:refs / remotes / origin / *
当我做时
git config --get-regexp'^(remote | branch)\''
我得到
remote.octopress.url git://github.com/imathis/octopress.git
remote.octopress.fetch + refs / heads / *:refs / remotes / octopress / *
branch.source .remote origin
branch.source.merge refs / heads / master
remote.origin.url git@github.com:manuweg / manuweg.github.com.git
emote.origin.fetch正如你所看到的那样,似乎在那里看起来似乎是这样的:+ refs / heads / *:refs / remotes / origin / *
在最后一行发生拼写错误
emote.origin.fetch + refs / heads / *:refs / remotes / origin / *
我认为这应该是:
remote.origin.fetch + refs / heads / *:refs / remotes / origin / *
远程原始URL是正确的,并为初始提交工作。
任何想法为什么我得到这个错误?
所以我解决了这个问题,与第一个来源相同的细节:
git remote add origin2 git@github.com:manuweg / manuweg.github.com.git
I recently came across the octopress blogging platform and followed the installation instructions. I am hosting it on github using github pages. I created a repository and successfully managed to make an initial commit. My problem came when I tried to make another commit and this is the message I got:
Immanuels-MacBook-Pro:octopress manuweg$ git add .
Immanuels-MacBook-Pro:octopress manuweg$ git commit -m "Changed origin url"
[source e0fff54] Changed origin url
1 files changed, 1 insertions(+), 1 deletions(-)
Immanuels-MacBook-Pro:octopress manuweg$ git push origin source
ERROR: Repository invalid.
fatal: The remote end hung up unexpectedly
This is the config in my .git/config file
[remote "origin"]
url = git@github.com:manuweg/manuweg.github.com.git
fetch = +refs/heads/*:refs/remotes/origin/*
When I do
git config --get-regexp '^(remote|branch)\.'
I get
remote.octopress.url git://github.com/imathis/octopress.git
remote.octopress.fetch +refs/heads/*:refs/remotes/octopress/*
branch.source.remote origin
branch.source.merge refs/heads/master
remote.origin.url git@github.com:manuweg/manuweg.github.com.git
emote.origin.fetch +refs/heads/*:refs/remotes/origin/*
As you can see there seems to be a spelling mistake on the last line
emote.origin.fetch +refs/heads/*:refs/remotes/origin/*
Which I assume should read:
remote.origin.fetch +refs/heads/*:refs/remotes/origin/*
The remote origin url is correct and worked for the initial commit. Any ideas why I am getting this error?
So I solved this problem by creating another origin with exactly the same details as the first origin:
git remote add origin2 git@github.com:manuweg/manuweg.github.com.git
这篇关于Git commit错误:存储库无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!