Git推送错误:没有找到存储库。

时间:2023-01-20 16:44:59

I am having a very strange problem with git and github. When I try and push, I am getting:

我对git和github有一个很奇怪的问题。当我尝试推,我得到:

git push -u origin master
ERROR: Repository not found.
fatal: The remote end hung up unexpectedly

I added the remote:

我添加了远程:

git remote add origin git@github.com:account-name/repo-name.git

Any ideas?

什么好主意吗?

31 个解决方案

#1


278  

Check to see if you have read-write access.

检查是否有读写访问。

The Git error message is misleading. I had a similar issue. I had been added to an existing project. I cloned it and committed a local change. I went to push and got the ERROR: Repository not found. error message.

Git错误消息具有误导性。我有一个类似的问题。我已经加入了一个现有的项目。我克隆了它并提交了一个本地更改。我去推并得到了错误:没有找到存储库。错误消息。

The person who added me to the project gave me read-only access to the repository. A change by them and I was able to push.

将我添加到项目中的人给了我对存储库的只读访问权。他们改变了我,我也能推动。

#2


70  

I ran into the same issue and I solved it by including my username and password in the repo url:

我遇到了同样的问题,我通过在repo url中包含用户名和密码解决了这个问题:

git clone https://myusername:mypassword@github.com/path_to/myRepo.git

#3


42  

I was getting the same error

我也犯了同样的错误。

ERROR: Repository not found.   
fatal: The remote end hung up unexpectedly

and I had created the repository on Github and cloned it locally.

我在Github上创建了存储库并在本地克隆了它。

I was able to solve by opening .git/config and removing the [remote "origin"] section.

我可以通过打开.git/config并删除[远程“原点”]部分来解决。

[remote "origin"]   
   url = git@github.com:alexagui/my_project.git  
   fetch = +refs/heads/*:refs/remotes/origin/*

then I ran the following (again)

然后我又运行了如下(同样)

git remote add origin git@github.com:alexagui/my_project.git  
git push -u origin master

and this time I was able to push to the repository.

这一次,我可以推到存储库。

#4


18  

I got this error (but before was working). My problem was the missing ssh key binded with the Github account. You can check you current ssh keys with ssh-add -l.

我犯了这个错误(但在工作之前)。我的问题是丢失的ssh密钥与Github帐户绑定。您可以使用ssh-add -l检查当前的ssh密钥。

If your key is missing, you can add it with

如果你的钥匙不见了,你可以加进去。

ssh-add ~/.ssh/your_key

#5


14  

git remote rm origin
git remote add origin <remote url>

#6


13  

I had a similar problem. The incorrect credentials were cached in OS X's key-chain.

我也有类似的问题。错误的凭据被缓存到OS X的键链中。

Check out: https://help.github.com/articles/updating-credentials-from-the-osx-keychain

查阅:https://help.github.com/articles/updating-credentials-from-the-osx-keychain

#7


7  

Had similar issue. The root of the problem was that I followed some online tutorial about adding a new repository to Github.

有类似的问题。问题的根源在于,我遵循了一些在线教程,向Github添加了一个新的存储库。

Just go to Github, create a new repo, it will ask you to add a README, don't add it. Create it, and you'll get instructions on how to push.

去Github,创建一个新的repo,它会要求你添加一个README,不要添加它。创建它,你就会得到如何推送的指令。

It's similar to the next two lines:

它类似于下面两行:

git remote add origin https://github.com/YOUR_USER/your-repo.git
git push -u origin master

#8


7  

I had the same problem, with a private repo.

我遇到了同样的问题,一个私人的回答。

do the following:

执行以下操作:

remove the remote origin

删除远程起源

`git remote rm origin`

re-add the origin but with your username and pwd with writing privileges on this pvt repo

重新添加来源,但使用您的用户名和pwd与在此pvt repo上的写入权限。

git remote add origin  https://USERNAME:PASSWORD@github.com/username/reponame.git

#9


6  

If you belong to a group in Github check that you have Write Access.

如果您属于Github中的一个组,请检查您是否有写访问权限。

#10


5  

This Solved my problem.

这解决了我的问题。

   git pull https://myusername:mypassword@github.com/path_to/myRepo.git

#11


4  

You need to check your SSH access as the following:

您需要检查您的SSH访问如下:

ssh -T git@github.com

this issue was because i don't add the person response on SSH in repository, read more about SSH link-1, link-2.

这个问题是因为我没有在存储库中添加person响应,请阅读更多关于SSH link-1、link-2的信息。

#12


4  

The following solved the problem for me.

以下为我解决了这个问题。

First I used this command to figure what was the github account used:

首先,我用这个命令来计算使用的github账户是什么:

ssh -T git@github.com

This gave me an answer like this:

这给了我一个这样的回答:

Hi <github_account_name>! You've successfully authenticated, but GitHub does not provide shell access. I just had to give the access to fix the problem.

Then I understood that the Github user described in the answer (github_account_name) wasn't authorized on the Github repository I was trying to pull.

然后我了解到,答案(github_account_name)中描述的Github用户在我试图拉的Github存储库中没有得到授权。

#13


4  

If anybody faced the issue at github.com check if you have accepted an invitation after repo owner allowed commits to you. Until you accept invitation repo will be invisible for you. So you'll get ERROR: Repository not found.

如果有人在github.com上遇到这个问题,请检查你是否已经接受了repo owner允许提交给你的邀请。在你接受邀请之前,你是看不到的。因此您会得到错误:没有找到存储库。

#14


4  

That's what worked for me:

这就是我的工作:

1. The Remotes

1。的遥控器

$ git remote rm origin
$ git remote add origin git@github.com:<USER>/<REPO>.git

If your SSH key is already in use on another github rep, you can generate a new one.

如果您的SSH密钥已经在另一个github代理上使用,您可以生成一个新的。

2. Generating a new SSH key

2。生成新的SSH密钥。

$ ssh-keygen -t rsa -b 4096 -C "web@github.com"

3. Addition of the key at the SSH agent level

3所示。在SSH代理级别添加密钥。

$ eval "$(ssh-agent -s)"
$ ssh-add ~/.ssh/id_rsa_github

4. Add the new key to the Github repo.

4所示。向Github repo添加新键。

#15


3  

Changing the content of the .git/config file helps as Alex said above. I experienced the same problem and I think it was because I changed my Github username. The local files could not be updated with the changes. So perhaps anytime you change your username you might consider running

更改.git/config文件的内容,正如Alex所说的。我遇到了同样的问题,我想是因为我改变了我的Github用户名。无法对本地文件进行更改。所以,当你改变你的用户名时,你可能会考虑跑步。

git remote add origin your_ssh_link_from_github

git远程添加来源your_ssh_link_from_github。

I hope this helps ;)

我希望这能有所帮助;

#16


2  

If you include your username and the repo name we can reasonably help you, at the moment we have no reason to think the repo does actually exist.

如果您包含您的用户名和我们可以合理帮助您的repo名称,目前我们没有理由认为repo确实存在。

Additionally, if the repo is private and you don't have access to it, github returns "Does not exist" to avoid disclosing the existance of private repos.

另外,如果repo是私有的,并且您无法访问它,那么github返回“不存在”,以避免泄露私有repos的存在。

EDIT: If you're not able to clone it because it's saying it doesn't exist and it's private, it's because you're not sending authentication. Ensure that your public key is added to your keyring, or use HTTP basic auth for the time being.

编辑:如果你不能克隆它,因为它说它不存在,而且它是私有的,那是因为你没有发送身份验证。确保您的公钥被添加到您的密匙环中,或者暂时使用HTTP basic auth。

#17


2  

I had this issue and realized I was using a different account from the one whose repo it was. Logging in as the original user resolved the issue.

我有这个问题,我意识到我使用的是一个不同的账户,这个账户是我的。登录时,原始用户解决了这个问题。

#18


2  

If you use private repository check you connection user, it must have permission for use repository.

如果您使用私有存储库检查连接用户,那么它必须拥有使用存储库的权限。

#19


1  

I had the same problem. My issue was misunderstanding that I had to first create the empty repo on github before pushing to it. Doh! Including this here for anyone else who doesn't realize.

我遇到了同样的问题。我的问题是误会,我必须先在github上创建一个空的repo,然后再推它。哎!包括这个,给其他没有意识到的人。

#20


1  

go to your project folder then search for the .git folder, then open the config file with notepad and check if there is your link to the github repo under: [remote "origin"], if it is different then the repo in your github then just edit it, or open a new repo with the name in the in config file

去你的项目文件夹然后搜索.文件夹,然后用记事本打开配置文件,并检查是否有你的链接到github回购:下(远程“起源”),如果是不同回购在github然后编辑它,或打开一个新的回购在配置文件中的名称

#21


1  

Have experienced the same problem. Everything was working fine for years and then suddenly this error.

经历过同样的问题。多年来一切都很正常,然后突然出现了这个错误。

The problem turns out was that I added a deploy key for another repo to my SSH agent before my user's github SSH key (which I always used to access the repo in question). SSH agent tried the deploy key for another repo first, and GitHub for some totally unexplainable reason was saying

问题是,在我的用户的github SSH密钥(我总是用它来访问repo)之前,我在我的SSH代理上添加了一个部署键。SSH代理尝试了另一个repo的部署键,而GitHub则表示了一些完全无法解释的原因。

ERROR: Repository not found.

Once I've removed the deploy key from SSH agent, everything was back to normal.

一旦我从SSH代理中删除了部署密钥,一切就恢复正常了。

#22


1  

My solution may be useful to some of you.

我的解决方案可能对你们中的一些人有用。

I got the same error after updating my macbook's OS to Yosemite. My problem got fixed by recreating my ssh key. You can do this by following step 2 of this page: https://help.github.com/articles/generating-ssh-keys/

我把macbook的操作系统升级到约塞米蒂(Yosemite)后,也犯了同样的错误。通过重新创建ssh密钥,我的问题得到了解决。您可以通过以下步骤2来完成:https://help.github.com/articles/generating-ssh-keys/。

#23


1  

Here is how to solve my issue

下面是如何解决我的问题。

#check current github account
ssh -T git@github.com

#ensure the correct ssh key used with github
ssh-agent -s
ssh-add ~/.ssh/YOUR-GITHUB-KEY

#re-add the origin
git remote add origin git@github.com:YOUR-USER/YOUR-REPO.GIT
git push -u origin master

#24


1  

I had the same problem. Try the following:

1. Modifying the Keychain Access in Mac for git credentials solved the problem for me.
2. Resetting origin url

我遇到了同样的问题。试试以下:1。为git凭证修改Mac的Keychain访问解决了我的问题。2。重置起源url

git remote rm origin
git remote add origin git@github.com:account-name/repo-name.git

#25


0  

I faced same error after updating my ubuntu to next version

在更新ubuntu到下一个版本后,我遇到了同样的错误。

I just deleted my sshkey on github account and then re added an sshkey to that account.

我刚刚在github上删除了我的sshkey,然后重新添加了一个sshkey到那个帐户。

#26


0  

I was getting the same error coz I change my github user name, then I do this:

我得到了相同的错误因为我改变了我的github用户名,然后我这样做:

git remote -v

then:

然后:

git remote set-url newname newurl 
git push -u origin master

this time I was able to push to the repository. I hope this helps.

这一次我可以把它推到存储库。我希望这可以帮助。

#27


0  

first Create a new repository on the command line, name like Ademo.git

首先在命令行上创建一个新的存储库,如Ademo.git。

Create a new repository on the command line

在命令行上创建一个新的存储库。

touch README.md git init git add README.md git commit -m "first commit" git remote add origin https://github.com/your_name/Ademo.git git push -u origin master

触摸README。我添加了README。mdgit提交-m“第一次提交”git远程添加源,https://github.com/your_name/Ademo.git推-u源程序。

Push an existing repository from the command line

从命令行中推送现有的存储库。

git remote add origin https://github.com/your_name/Ademo.git git push -u origin master

git远程添加来源:https://github.com/your_name/Ademo.git git push - uorigin master。

#28


0  

Create a Fork

If don't have write access to that repository, you don't need it. Create a fork by following these instructions -- it's your own clone of the repository which you can modify freely.

如果没有对该存储库的写访问权限,您就不需要它。按照这些指示创建一个fork——它是您自己可以*修改的存储库的克隆。

After creating the fork, you can then clone that repo to your computer.

在创建了fork之后,您可以将该repo克隆到您的计算机上。

git clone git@github.com:<your-git-handle>/<repository>.git
// It will be cloned to your machine where you run the command 
// under a <repository> folder that it will create.

Checkout a new branch and make changes.

签出一个新的分支并进行更改。

git checkout -b my-new-feature

To submit your changes to the original repository, you'll need to make sure that they're pushed

要将更改提交到原始存储库,您需要确保它们被推送。

/* make changes */
git commit -am "New Feature: Made a new feature!"
git push origin my-new-feature

To get these changes into the original repository that you forked from, you can submit a Pull Requests by following these instructions. A Pull Request basically, you request that the user with write access to a repository pull down the changes you've made. Think of it like "I request that you pull my changes into your repo."

要将这些更改转换到您所放弃的原始存储库,您可以按照以下指示提交一个Pull请求。基本上,您请求使用写访问存储库的用户拉下您所做的更改。你可以这样想:“我请求你把我的修改变成你的回复。”


Note: Your fork will not stay up-to-date with all of the changes going on in the original repository, though. You'll have to pull down those changes periodically -- but this is easy.

注意:您的fork不会与原始存储库中发生的所有更改保持同步。你必须定期把这些变化拉下来——但这很容易。

After creating the fork, you can link to repo that you've forked from so that you can pull in it's changes and keep stay current.

在创建了fork之后,您可以链接到您已经放弃的repo,这样您就可以对它进行更改并保持当前状态。

git remote add upstream git@github.com:<git-user-handle>/<repository>.git

Once you've done that, keeping in sync with the changes made on the original repo is quite easy.

一旦你这样做了,保持与原来的repo所做的改变是相当容易的。

git checkout master         // checkout your local master
git pull upstream master    // fetch changes from the master branch of the repo you forked from.. which is linked to your fork under the alias "upstream" (common naming convention)
git push origin master      // push the pulled changes onto your local master
git checkout -b new-branch  // create a new branch and start making changes

#29


0  

Also be sure to check whether you have desktop client installed. I double checked everything, my permission, SSH, but turns out my repo listed in the client was overriding the one I was inputting via terminal.

还要检查是否安装了桌面客户端。我检查了所有的东西,我的权限,SSH,但是我在客户端列出的repo正在覆盖我正在输入的终端。

#30


0  

So for me, my password had a ` (tick) in it and PhpStorm was removing the character before sending the git push:

所以对我来说,我的密码有一个“(滴答)”,PhpStorm在发送git push之前删除了字符:

Lets say for this example my password is _pa``ssword_

对于这个例子,我的密码是_pa ' ' ssword_。

Phpstorm would output the following:

Phpstorm输出如下:

https://_username_:_password_@github.com/_username_/repo.git

https://_username_:_password_@github.com/_username_/repo.git

instead of

而不是

https://_username_:_pa``ssword_@github.com/_username_/repo.git

https://_username_ _pa“ssword_@github.com/_username_/repo.git

Changed password to something not using the ` character. WORKS!!!

将密码更改为不使用“字符”的内容。工作! ! !

#1


278  

Check to see if you have read-write access.

检查是否有读写访问。

The Git error message is misleading. I had a similar issue. I had been added to an existing project. I cloned it and committed a local change. I went to push and got the ERROR: Repository not found. error message.

Git错误消息具有误导性。我有一个类似的问题。我已经加入了一个现有的项目。我克隆了它并提交了一个本地更改。我去推并得到了错误:没有找到存储库。错误消息。

The person who added me to the project gave me read-only access to the repository. A change by them and I was able to push.

将我添加到项目中的人给了我对存储库的只读访问权。他们改变了我,我也能推动。

#2


70  

I ran into the same issue and I solved it by including my username and password in the repo url:

我遇到了同样的问题,我通过在repo url中包含用户名和密码解决了这个问题:

git clone https://myusername:mypassword@github.com/path_to/myRepo.git

#3


42  

I was getting the same error

我也犯了同样的错误。

ERROR: Repository not found.   
fatal: The remote end hung up unexpectedly

and I had created the repository on Github and cloned it locally.

我在Github上创建了存储库并在本地克隆了它。

I was able to solve by opening .git/config and removing the [remote "origin"] section.

我可以通过打开.git/config并删除[远程“原点”]部分来解决。

[remote "origin"]   
   url = git@github.com:alexagui/my_project.git  
   fetch = +refs/heads/*:refs/remotes/origin/*

then I ran the following (again)

然后我又运行了如下(同样)

git remote add origin git@github.com:alexagui/my_project.git  
git push -u origin master

and this time I was able to push to the repository.

这一次,我可以推到存储库。

#4


18  

I got this error (but before was working). My problem was the missing ssh key binded with the Github account. You can check you current ssh keys with ssh-add -l.

我犯了这个错误(但在工作之前)。我的问题是丢失的ssh密钥与Github帐户绑定。您可以使用ssh-add -l检查当前的ssh密钥。

If your key is missing, you can add it with

如果你的钥匙不见了,你可以加进去。

ssh-add ~/.ssh/your_key

#5


14  

git remote rm origin
git remote add origin <remote url>

#6


13  

I had a similar problem. The incorrect credentials were cached in OS X's key-chain.

我也有类似的问题。错误的凭据被缓存到OS X的键链中。

Check out: https://help.github.com/articles/updating-credentials-from-the-osx-keychain

查阅:https://help.github.com/articles/updating-credentials-from-the-osx-keychain

#7


7  

Had similar issue. The root of the problem was that I followed some online tutorial about adding a new repository to Github.

有类似的问题。问题的根源在于,我遵循了一些在线教程,向Github添加了一个新的存储库。

Just go to Github, create a new repo, it will ask you to add a README, don't add it. Create it, and you'll get instructions on how to push.

去Github,创建一个新的repo,它会要求你添加一个README,不要添加它。创建它,你就会得到如何推送的指令。

It's similar to the next two lines:

它类似于下面两行:

git remote add origin https://github.com/YOUR_USER/your-repo.git
git push -u origin master

#8


7  

I had the same problem, with a private repo.

我遇到了同样的问题,一个私人的回答。

do the following:

执行以下操作:

remove the remote origin

删除远程起源

`git remote rm origin`

re-add the origin but with your username and pwd with writing privileges on this pvt repo

重新添加来源,但使用您的用户名和pwd与在此pvt repo上的写入权限。

git remote add origin  https://USERNAME:PASSWORD@github.com/username/reponame.git

#9


6  

If you belong to a group in Github check that you have Write Access.

如果您属于Github中的一个组,请检查您是否有写访问权限。

#10


5  

This Solved my problem.

这解决了我的问题。

   git pull https://myusername:mypassword@github.com/path_to/myRepo.git

#11


4  

You need to check your SSH access as the following:

您需要检查您的SSH访问如下:

ssh -T git@github.com

this issue was because i don't add the person response on SSH in repository, read more about SSH link-1, link-2.

这个问题是因为我没有在存储库中添加person响应,请阅读更多关于SSH link-1、link-2的信息。

#12


4  

The following solved the problem for me.

以下为我解决了这个问题。

First I used this command to figure what was the github account used:

首先,我用这个命令来计算使用的github账户是什么:

ssh -T git@github.com

This gave me an answer like this:

这给了我一个这样的回答:

Hi <github_account_name>! You've successfully authenticated, but GitHub does not provide shell access. I just had to give the access to fix the problem.

Then I understood that the Github user described in the answer (github_account_name) wasn't authorized on the Github repository I was trying to pull.

然后我了解到,答案(github_account_name)中描述的Github用户在我试图拉的Github存储库中没有得到授权。

#13


4  

If anybody faced the issue at github.com check if you have accepted an invitation after repo owner allowed commits to you. Until you accept invitation repo will be invisible for you. So you'll get ERROR: Repository not found.

如果有人在github.com上遇到这个问题,请检查你是否已经接受了repo owner允许提交给你的邀请。在你接受邀请之前,你是看不到的。因此您会得到错误:没有找到存储库。

#14


4  

That's what worked for me:

这就是我的工作:

1. The Remotes

1。的遥控器

$ git remote rm origin
$ git remote add origin git@github.com:<USER>/<REPO>.git

If your SSH key is already in use on another github rep, you can generate a new one.

如果您的SSH密钥已经在另一个github代理上使用,您可以生成一个新的。

2. Generating a new SSH key

2。生成新的SSH密钥。

$ ssh-keygen -t rsa -b 4096 -C "web@github.com"

3. Addition of the key at the SSH agent level

3所示。在SSH代理级别添加密钥。

$ eval "$(ssh-agent -s)"
$ ssh-add ~/.ssh/id_rsa_github

4. Add the new key to the Github repo.

4所示。向Github repo添加新键。

#15


3  

Changing the content of the .git/config file helps as Alex said above. I experienced the same problem and I think it was because I changed my Github username. The local files could not be updated with the changes. So perhaps anytime you change your username you might consider running

更改.git/config文件的内容,正如Alex所说的。我遇到了同样的问题,我想是因为我改变了我的Github用户名。无法对本地文件进行更改。所以,当你改变你的用户名时,你可能会考虑跑步。

git remote add origin your_ssh_link_from_github

git远程添加来源your_ssh_link_from_github。

I hope this helps ;)

我希望这能有所帮助;

#16


2  

If you include your username and the repo name we can reasonably help you, at the moment we have no reason to think the repo does actually exist.

如果您包含您的用户名和我们可以合理帮助您的repo名称,目前我们没有理由认为repo确实存在。

Additionally, if the repo is private and you don't have access to it, github returns "Does not exist" to avoid disclosing the existance of private repos.

另外,如果repo是私有的,并且您无法访问它,那么github返回“不存在”,以避免泄露私有repos的存在。

EDIT: If you're not able to clone it because it's saying it doesn't exist and it's private, it's because you're not sending authentication. Ensure that your public key is added to your keyring, or use HTTP basic auth for the time being.

编辑:如果你不能克隆它,因为它说它不存在,而且它是私有的,那是因为你没有发送身份验证。确保您的公钥被添加到您的密匙环中,或者暂时使用HTTP basic auth。

#17


2  

I had this issue and realized I was using a different account from the one whose repo it was. Logging in as the original user resolved the issue.

我有这个问题,我意识到我使用的是一个不同的账户,这个账户是我的。登录时,原始用户解决了这个问题。

#18


2  

If you use private repository check you connection user, it must have permission for use repository.

如果您使用私有存储库检查连接用户,那么它必须拥有使用存储库的权限。

#19


1  

I had the same problem. My issue was misunderstanding that I had to first create the empty repo on github before pushing to it. Doh! Including this here for anyone else who doesn't realize.

我遇到了同样的问题。我的问题是误会,我必须先在github上创建一个空的repo,然后再推它。哎!包括这个,给其他没有意识到的人。

#20


1  

go to your project folder then search for the .git folder, then open the config file with notepad and check if there is your link to the github repo under: [remote "origin"], if it is different then the repo in your github then just edit it, or open a new repo with the name in the in config file

去你的项目文件夹然后搜索.文件夹,然后用记事本打开配置文件,并检查是否有你的链接到github回购:下(远程“起源”),如果是不同回购在github然后编辑它,或打开一个新的回购在配置文件中的名称

#21


1  

Have experienced the same problem. Everything was working fine for years and then suddenly this error.

经历过同样的问题。多年来一切都很正常,然后突然出现了这个错误。

The problem turns out was that I added a deploy key for another repo to my SSH agent before my user's github SSH key (which I always used to access the repo in question). SSH agent tried the deploy key for another repo first, and GitHub for some totally unexplainable reason was saying

问题是,在我的用户的github SSH密钥(我总是用它来访问repo)之前,我在我的SSH代理上添加了一个部署键。SSH代理尝试了另一个repo的部署键,而GitHub则表示了一些完全无法解释的原因。

ERROR: Repository not found.

Once I've removed the deploy key from SSH agent, everything was back to normal.

一旦我从SSH代理中删除了部署密钥,一切就恢复正常了。

#22


1  

My solution may be useful to some of you.

我的解决方案可能对你们中的一些人有用。

I got the same error after updating my macbook's OS to Yosemite. My problem got fixed by recreating my ssh key. You can do this by following step 2 of this page: https://help.github.com/articles/generating-ssh-keys/

我把macbook的操作系统升级到约塞米蒂(Yosemite)后,也犯了同样的错误。通过重新创建ssh密钥,我的问题得到了解决。您可以通过以下步骤2来完成:https://help.github.com/articles/generating-ssh-keys/。

#23


1  

Here is how to solve my issue

下面是如何解决我的问题。

#check current github account
ssh -T git@github.com

#ensure the correct ssh key used with github
ssh-agent -s
ssh-add ~/.ssh/YOUR-GITHUB-KEY

#re-add the origin
git remote add origin git@github.com:YOUR-USER/YOUR-REPO.GIT
git push -u origin master

#24


1  

I had the same problem. Try the following:

1. Modifying the Keychain Access in Mac for git credentials solved the problem for me.
2. Resetting origin url

我遇到了同样的问题。试试以下:1。为git凭证修改Mac的Keychain访问解决了我的问题。2。重置起源url

git remote rm origin
git remote add origin git@github.com:account-name/repo-name.git

#25


0  

I faced same error after updating my ubuntu to next version

在更新ubuntu到下一个版本后,我遇到了同样的错误。

I just deleted my sshkey on github account and then re added an sshkey to that account.

我刚刚在github上删除了我的sshkey,然后重新添加了一个sshkey到那个帐户。

#26


0  

I was getting the same error coz I change my github user name, then I do this:

我得到了相同的错误因为我改变了我的github用户名,然后我这样做:

git remote -v

then:

然后:

git remote set-url newname newurl 
git push -u origin master

this time I was able to push to the repository. I hope this helps.

这一次我可以把它推到存储库。我希望这可以帮助。

#27


0  

first Create a new repository on the command line, name like Ademo.git

首先在命令行上创建一个新的存储库,如Ademo.git。

Create a new repository on the command line

在命令行上创建一个新的存储库。

touch README.md git init git add README.md git commit -m "first commit" git remote add origin https://github.com/your_name/Ademo.git git push -u origin master

触摸README。我添加了README。mdgit提交-m“第一次提交”git远程添加源,https://github.com/your_name/Ademo.git推-u源程序。

Push an existing repository from the command line

从命令行中推送现有的存储库。

git remote add origin https://github.com/your_name/Ademo.git git push -u origin master

git远程添加来源:https://github.com/your_name/Ademo.git git push - uorigin master。

#28


0  

Create a Fork

If don't have write access to that repository, you don't need it. Create a fork by following these instructions -- it's your own clone of the repository which you can modify freely.

如果没有对该存储库的写访问权限,您就不需要它。按照这些指示创建一个fork——它是您自己可以*修改的存储库的克隆。

After creating the fork, you can then clone that repo to your computer.

在创建了fork之后,您可以将该repo克隆到您的计算机上。

git clone git@github.com:<your-git-handle>/<repository>.git
// It will be cloned to your machine where you run the command 
// under a <repository> folder that it will create.

Checkout a new branch and make changes.

签出一个新的分支并进行更改。

git checkout -b my-new-feature

To submit your changes to the original repository, you'll need to make sure that they're pushed

要将更改提交到原始存储库,您需要确保它们被推送。

/* make changes */
git commit -am "New Feature: Made a new feature!"
git push origin my-new-feature

To get these changes into the original repository that you forked from, you can submit a Pull Requests by following these instructions. A Pull Request basically, you request that the user with write access to a repository pull down the changes you've made. Think of it like "I request that you pull my changes into your repo."

要将这些更改转换到您所放弃的原始存储库,您可以按照以下指示提交一个Pull请求。基本上,您请求使用写访问存储库的用户拉下您所做的更改。你可以这样想:“我请求你把我的修改变成你的回复。”


Note: Your fork will not stay up-to-date with all of the changes going on in the original repository, though. You'll have to pull down those changes periodically -- but this is easy.

注意:您的fork不会与原始存储库中发生的所有更改保持同步。你必须定期把这些变化拉下来——但这很容易。

After creating the fork, you can link to repo that you've forked from so that you can pull in it's changes and keep stay current.

在创建了fork之后,您可以链接到您已经放弃的repo,这样您就可以对它进行更改并保持当前状态。

git remote add upstream git@github.com:<git-user-handle>/<repository>.git

Once you've done that, keeping in sync with the changes made on the original repo is quite easy.

一旦你这样做了,保持与原来的repo所做的改变是相当容易的。

git checkout master         // checkout your local master
git pull upstream master    // fetch changes from the master branch of the repo you forked from.. which is linked to your fork under the alias "upstream" (common naming convention)
git push origin master      // push the pulled changes onto your local master
git checkout -b new-branch  // create a new branch and start making changes

#29


0  

Also be sure to check whether you have desktop client installed. I double checked everything, my permission, SSH, but turns out my repo listed in the client was overriding the one I was inputting via terminal.

还要检查是否安装了桌面客户端。我检查了所有的东西,我的权限,SSH,但是我在客户端列出的repo正在覆盖我正在输入的终端。

#30


0  

So for me, my password had a ` (tick) in it and PhpStorm was removing the character before sending the git push:

所以对我来说,我的密码有一个“(滴答)”,PhpStorm在发送git push之前删除了字符:

Lets say for this example my password is _pa``ssword_

对于这个例子,我的密码是_pa ' ' ssword_。

Phpstorm would output the following:

Phpstorm输出如下:

https://_username_:_password_@github.com/_username_/repo.git

https://_username_:_password_@github.com/_username_/repo.git

instead of

而不是

https://_username_:_pa``ssword_@github.com/_username_/repo.git

https://_username_ _pa“ssword_@github.com/_username_/repo.git

Changed password to something not using the ` character. WORKS!!!

将密码更改为不使用“字符”的内容。工作! ! !