Git 错误:conq:存储库不存在

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8927070/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 12:46:47  来源:igfitidea点击:

Git error: conq: repository does not exist

gitbitbucket

提问by jaffa

I'm getting the following errors in Git using BitBucket:

我在使用 BitBucket 的 Git 中遇到以下错误:

conq: repository does not exist.
fatal: The remote end hung up unexpectedly

How do I rectify this issue? I've carried out the following:

我该如何解决这个问题?我进行了以下操作:

git init .   
git remote add origin [email protected]:myname/myproject.git
git add .
git commit -m "..."

git push  <<< error occurs here

I've set-up BitBucket with the ssh key and repo is shown on dashboard.

我已经使用 ssh 密钥设置了 BitBucket,并且 repo 显示在仪表板上。

采纳答案by jaffa

I managed to do this in the end by removing the origin and re-adding it. Everything seemed ok after I did this.

我最终通过删除原点并重新添加它来做到这一点。在我这样做之后,一切似乎都很好。

回答by Malloc

In my case, the git repository was duplicated somehow in the config file:

就我而言,git 存储库以某种方式在配置文件中复制:

cat .git/config

gave me:

给我:

[remote "origin"]
    url = [email protected]:myUserName/myRepositoryName.git/myRepositoryName.git
    fetch = +refs/heads/*:refs/remotes/origin/*

As you can see, myRepositoryName is duplicated, so I removed that, and now the config file looks like this:

如您所见,myRepositoryName 是重复的,因此我将其删除,现在配置文件如下所示:

[remote "origin"]
    url = [email protected]:myUserName/myRepositoryName.git
    fetch = +refs/heads/*:refs/remotes/origin/*

Doing this, my problem is solved. Now the push is correctly done. Hope this help someone.

这样做,我的问题就解决了。现在推送已正确完成。希望这有助于某人。

回答by Igor Parra

This error also occur when you rename your repo:

重命名 repo 时也会发生此错误:

Edit .git/config and change from:

编辑 .git/config 并更改为:

git remote add origin [email protected]:myname/myproject.git

to:

到:

git remote add origin [email protected]:myname/my_new_project_name.git

回答by hasentopf

git remote rm origin
git remote add origin git@github_or_bitbucket_or_whatever_link

回答by bdanin

I had a similar problem, and this thread helped me solve the issue, but my solution is slightly different:

我有一个类似的问题,这个线程帮助我解决了这个问题,但我的解决方案略有不同:

I was on a remote server, so first I had to change into the public_html (www) directory, then initialize the repo. (note you have to first add your .ssh key in bitbucket)

我在远程服务器上,所以首先我必须切换到 public_html (www) 目录,然后初始化 repo。(请注意,您必须先在 bitbucket 中添加 .ssh 密钥)

$ git init

which initialized an empty Git repository

它初始化了一个空的 Git 存储库

then add the remote

然后添加遥控器

$ git remote add origin [email protected]:myname/myproject.git

then I was able to pull and checkout my branch

然后我就可以拉出并结帐我的分支

$ git pull
$ git checkout <branch-name>

回答by Martin Geisler

You get this error if the remote repository hasn't been created. Bitbucket is running a service called conqthat handles pushes and you see the error message from it. Simply create a new (empty) repository and the push should succeed.

如果尚未创建远程存储库,则会出现此错误。Bitbucket 正在运行一个名为conq处理推送的服务,您会从中看到错误消息。只需创建一个新的(空)存储库,推送就会成功。

Here I'm pushing to a non-existing repository:

在这里,我推送到一个不存在的存储库:

$ git push [email protected]:mg/testt.git master
conq: repository does not exist.
fatal: The remote end hung up unexpectedly

and here I push to the correct path:

在这里我推到正确的路径:

$ git push [email protected]:mg/test.git master
Counting objects: 3, done.
Writing objects: 100% (3/3), 203 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: bb/acl: mg is allowed. accepted payload.
To [email protected]:mg/gtest.git
 * [new branch]      master -> master

The testrepository was newly created on Bitbucket. If the problem persists, then I suggest deleting the empty repo from Bitbucket and re-creating it.

test存储库是在 Bitbucket 上新创建的。如果问题仍然存在,那么我建议从 Bitbucket 中删除空的 repo 并重新创建它。

回答by sgryzko

Did you encounter this error doing the Rails Tutorial?

您在执行Rails 教程时遇到过这个错误吗?

I did. And I'm very new to this so I was only doing was the tutorial explicitly told me to do. That got me into trouble because in chapter 3 it says it's a good idea to create a new repository at Bitbucket and push it upbut it doesn't hold your hand through the process like it does in Chapter 2.

我做到了。我对此很陌生,所以我只是在做教程明确告诉我要做的事情。这让我遇到了麻烦,因为在第 3 章中它说在 Bitbucket 上创建一个新的存储库并将其推送是一个好主意,但它并没有像第 2 章那样在整个过程中控制你的手。

Don't forget to create the new repository at BitBucket before pushing to that repository.

在推送到该存储库之前,不要忘记在 BitBucket 上创建新存储库。

From Chapter 2: You should also create a new repository by clicking on the “Create” button at Bitbucket.

第 2 章开始您还应该通过单击 Bitbucket 上的“创建”按钮来创建一个新存储库。

I did that and it fixed the problem.

我这样做了,它解决了问题。

回答by Danish

In my case, i changed the repo name. Therefore, i was not able to push because changing repo name also changed repo remote url. Thus,

就我而言,我更改了回购名称。因此,我无法推送,因为更改 repo 名称也更改了 repo 远程 url。因此,

First remove previous remote url by git remote rm originnow add new one and do push.

首先删除以前的远程网址,git remote rm origin现在添加新网址并推送。

Hope it'll help someone. Cheers!

希望它会帮助某人。干杯!

回答by Ken Prince

I had this error when trying to deploy with Capistrano.

尝试使用 Capistrano 进行部署时出现此错误。

I was missing the deploy key for that Bitbucket repo.

我缺少那个 Bitbucket 存储库的部署密钥。

Here's how to solve the issue:

以下是解决问题的方法:

  1. Generate an SSH Key on your server: https://confluence.atlassian.com/display/STASH/Creating+SSH+keys
  2. Follow these instructions to get ssh-agent running, and load in the identity you just created: https://confluence.atlassian.com/display/BITBUCKET/Troubleshoot+SSH+Issues
  1. 在您的服务器上生成 SSH 密钥:https: //confluence.atlassian.com/display/STASH/Creating+SSH+keys
  2. 按照以下说明运行 ssh-agent,并加载您刚刚创建的身份:https: //confluence.atlassian.com/display/BITBUCKET/Troubleshoot+SSH+Issues

Once that's finished just go to the Bitbucket repo > Settings > Deploy Keys and copy and paste your newly created key.

完成后,只需转到 Bitbucket 存储库 > 设置 > 部署密钥,然后复制并粘贴您新创建的密钥。

回答by Berry Tsakala

in my case, i mixed up usernames:

就我而言,我混淆了用户名:

in my scenario there are 2 accounts: i need to connect using my-account to the repository's owner-account:

在我的场景中有 2 个帐户:我需要使用 my-account 连接到存储库的所有者帐户:

owner-acc   - created, maintaining the account
my-acc           - me, a participant

the syntax in this case should be

在这种情况下的语法应该是

url = [email protected]:owner-acc/repo-name.git

and NOT my username, nor my account-name.

而不是我的用户名,也不是我的帐户名。

I assume bitbucket's instructions I followed previously took care of identifying me somehow (it's probably relating my-account with the public key i uploaded earlier).

我假设我之前遵循的 bitbucket 指示以某种方式处理了我的身份(它可能将我的帐户与我之前上传的公钥相关联)。