fatal: 似乎不是 git 存储库
当我的 Git 存储库 URL 正确时,为什么会收到此错误?
fatal: '[email protected]/gittest.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
请在下面的上下文中查看它,或屏幕截图。
jitendra@JITENDRA-PC /c/mySite (master)
$ git push beanstalk master
fatal: '[email protected]/gittest.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
jitendra@JITENDRA-PC /c/mySite (master)
$ git clone git://github.com/jquery/jquery.git
Cloning into jquery...
Remote: Counting objects: 19803, done.
Remote: Compressing objects: 100% (5196/5196), done.
Remote: Total 19803 (delta 14204), reused 19549 (delta 14052)
Receiving objects: 100% (19803/19803), 12.80 MiB | 591 KiB/s, done.
Resolving deltas: 100% (14204/14204), done.
jitendra@JITENDRA-PC /c/mySite (master)
$ gitk --all
jitendra@JITENDRA-PC /c/mySite (master)
$ gitk -all
jitendra@JITENDRA-PC /c/mySite (master)
$ git remote add origin [email protected]/gittest.git
jitendra@JITENDRA-PC /c/mySite (master)
$ git push origin master
fatal: '[email protected]/gittest.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
jitendra@JITENDRA-PC /c/mySite (master)
Why am I getting this error when my Git repository URL is correct?
fatal: '[email protected]/gittest.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
See it in context below, or as a screenshot.
jitendra@JITENDRA-PC /c/mySite (master)
$ git push beanstalk master
fatal: '[email protected]/gittest.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
jitendra@JITENDRA-PC /c/mySite (master)
$ git clone git://github.com/jquery/jquery.git
Cloning into jquery...
Remote: Counting objects: 19803, done.
Remote: Compressing objects: 100% (5196/5196), done.
Remote: Total 19803 (delta 14204), reused 19549 (delta 14052)
Receiving objects: 100% (19803/19803), 12.80 MiB | 591 KiB/s, done.
Resolving deltas: 100% (14204/14204), done.
jitendra@JITENDRA-PC /c/mySite (master)
$ gitk --all
jitendra@JITENDRA-PC /c/mySite (master)
$ gitk -all
jitendra@JITENDRA-PC /c/mySite (master)
$ git remote add origin [email protected]/gittest.git
jitendra@JITENDRA-PC /c/mySite (master)
$ git push origin master
fatal: '[email protected]/gittest.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
jitendra@JITENDRA-PC /c/mySite (master)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(10)
您的
scp
式指定存储库的语法有点错误 - 它必须是:... 正如您在 git 克隆 文档。您应该使用 URL:
即在您使用的 URL 中,您错过了
:
(冒号)要更新您可以执行的原点 URL:
You've got the syntax for the
scp
-style way of specifying a repository slightly wrong - it has to be:... as you can see in the git clone documentation. You should use instead the URL:
i.e. in the URL you're using, you missed out the
:
(colon)To update the URL for origin you could do:
当我尝试将现有存储库存储在我的
Ubunt One
帐户中时,我遇到了类似的问题,我通过以下步骤修复了该问题:步骤 1:创建远程存储库
步骤 2:添加远程
第3步:将现有的git reop推送到远程
I met a similar problem when I tried to store my existing repo in my
Ubunt One
account, I fixed it by the following steps:Step-1: create remote repo
Step-2: add the remote
Step-3: push the exising git reop to the remote
这通常是因为您尚未在 Git 存储库上设置原始别名。
尝试
此操作将在您的
.git/config
文件中为远程克隆/推送/拉取站点 URL 添加别名。该 URL 可以在您的存储库概述页面上找到。This is typically because you have not set the origin alias on your Git repository.
Try
This will add an alias in your
.git/config
file for the remote clone/push/pull site URL. This URL can be found on your repository Overview page.我的本地和远程机器都是 OS X。直到我检查了 xCode Server 为我提供的 git 存储库的文件结构之前,我遇到了麻烦。本质上,该存储库中的所有内容都是 chmod 777 *,因此要在我的远程帐户中的同一台计算机上设置单独的非 xCode 存储库,我这样做了:
远程计算机
URL 中使用本地计算机
对于我来说,我学会了通过 git repo 重新开始LOCAL 和 REMOTE 需要首先在 shell 中进行所有初始工作。那么,经过上述
我能够在 IDE 中轻松设置本地和远程 git 存储库,并使用 IDE 的 GUI 执行所有基本 git 命令。
我遇到了困难,直到我先从远程开始,然后进行本地,直到我打开远程上的所有权限。此外,在 URL 中提供符号链接的准确完整路径对于成功至关重要。
同样,这一切都适用于 OS X、本地和远程计算机。
my local and remote machines are both OS X. I was having trouble until I checked the file structure of the git repo that xCode Server provides me. Essentially everything is chmod 777 * in that repo so to setup a separate non xCode repo on the same machine in my remote account there I did this:
REMOTE MACHINE
LOCAL MACHINE
For me, i learned getting a clean start with a git repo on a LOCAL and REMOTE requires all initial work in a shell first. Then, after the above
i was able to easily setup the LOCAL and REMOTE git repos in my IDE and do all the basic git commands using the GUI of the IDE.
I had difficulty until I started at the remote first, then did the local, and until i opened up all the permissions on remote. In addition, having the exact full path in the URL to the symlink was critical to succeed.
Again, this all worked on OS X, local and remote machines.
您很可能弄错了存储库的 SSH URL。
要进行确认,请转到 Github 上的存储库,然后单击
克隆或下载按钮
。然后单击使用 SSH
链接。现在复制您的官方存储库的 SSH 链接。我的看起来像这样 -
[email protected]:borenho/que -ay.git
您现在可以执行
git Remote add origin [电子邮件受保护]:borenho/que-ay.git
如果您还没有origin
。如果您之前设置了
origin
,请使用git remote set-url origin [email protected]:borenho/que-ay.git
现在使用
git push -u origin master
进行推送It is most likely that you got your repo's SSH URL wrong.
To confirm, go to your repository on Github and click the
clone or download button
. Then click theuse SSH
link.Now copy your official repo's SSH link. Mine looked like this -
[email protected]:borenho/que-ay.git
You can now do
git remote add origin [email protected]:borenho/que-ay.git
if you didn't haveorigin
yet.If you had set
origin
before, change it by usinggit remote set-url origin [email protected]:borenho/que-ay.git
Now push with
git push -u origin master
我的一个功能分支也面临着同样的问题。我尝试了上述解决方案,但没有任何效果。我通过执行以下操作解决了这个问题。
I was facing same issue with my one of my feature branch. I tried above mentioned solution nothing worked. I resolved this issue by doing following things.
我在使用 TFS 2017 时遇到了类似的问题。我无法推送或拉取 GIT 存储库。最终我重新安装了 TFS 2017,确保使用不同于 22 的 SSH 端口安装 TFS 2017(在我的例子中,我选择了 8022)。之后,可以使用 SSH 对 TFS 进行推送和拉取。
I had a similar problem when using TFS 2017. I was not able to push or pull GIT repositories. Eventually I reinstalled TFS 2017, making sure that I installed TFS 2017 with an SSH Port different from 22 (in my case, I chose 8022). After that, push and pull became possible against TFS using SSH.
这些对我来说都不起作用。问题似乎更加平凡......
我花了大约一天的时间才弄清楚我的 Synology 卷的名称不是“Volume1”而是“volume1”。
考虑到 URL 通常不区分大小写,Windows 文件路径也不区分大小写,最后但并非最不重要的一点是:DSM 用户界面(例如 Hyper Backup)中对volume1 的引用都是大写的! (让他们看起来好看?)。我终于在 SSH 中发现它在更改目录时注意到大小写很重要。指定远程存储库的 URL 时也是如此。
None of this worked for me. The problem appeared to be a lot more mundane...
I spent about a day figuring out the name of my Synology volume is not "Volume1" but "volume1".
I do not feel that stupid about it considering URLs are typically not case sensitive, Windows file paths are not case sensitive and last but not least: references to volume1 in the DSM user interface (e.g. Hyper Backup) are capitalized! (to make them look nice?). I finally found it poking around in SSH noticing that casing mattered when changing directories. And so it does when specifying the URL for the remote repository.
我遇到了类似的问题。
就我而言,要解决的问题是取消设置环境变量 HOMEBREW_BREW_GIT_REMOTE。
I got similar issue.
In my case to solve was to unset the environment variable HOMEBREW_BREW_GIT_REMOTE.
我也有类似的问题,但现在我知道原因了。
当我们使用
git init
之后,我们应该添加一个远程仓库,注意
name
这个词,如果我们把它改成origin
,那么这个问题不会发生。当然,如果我们将其更改为
py
,那么每次拉动和推送东西时都使用git pull pybranch
和gitpush pybranch
也可以。I have a similar problem, but now I know the reason.
After we use
git init
, we should add a remote repository usingPay attention to the word
name
, if we change it toorigin
, then this problem will not happen.Of course, if we change it to
py
, then usinggit pull py branch
andgit push py branch
every time you pull and push something will also be OK.