推动更改Git不起作用 [英] Push Changes to Git not Functioning

查看:161
本文介绍了推动更改Git不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每次我想提交命令git push heroku master时,我都会在PowerShell中要求输入凭据。当我输入heroku凭证(默认情况下连接到git)时,我收到错误消息。



但是,当我在家中输入netrc文件中包含的凭证目录,那么东西的功能。但是我认为密码是散列的。如何避免每次我想将更改推送到git?

更新:

  PS C:\ Users \Dragan\heroku_workspace\python-getting-started> git push heroku master 
github --credentials get:github:找不到命令
'https://git.heroku.com'的用户名:my-email@hotmail.com
密码'https://my-email@hotmail.com@git.heroku.com':
github --credentials擦除:github:找不到命令
remote:!警告:
remote:!不要使用git使用用户名和密码进行身份验证。
remote:!运行`heroku login`来更新您的凭证,然后重试git命令。
remote:!详情请参阅文档:http://devcenter.heroku.com/articles/http-git#authentication
致命:https://git.heroku.com/mysterious-river-71834.git/身份验证失败'


解决方案

常见的错误是使用默认的HTTPS )而不是SSH。您可以通过转到您的存储库,单击URL左边的ssh按钮来更正此问题,并更新您的原始远程URL,如下所示:

git remote set-url origin git @ github.com:username / repo.git



或者您的存储库已经存在,然后点击绿色按钮克隆或下载并选择使用 SSH



启用SSH身份验证



$ heroku create --ssh-git



将高HTTPS调用重定向到SSH (如果你想在特定的机器上总是使用SSH Git和Heroku)



$ git config --global url.ssh://git@heroku.com/.insteadOf https://git.heroku.com/



生成一个公钥:



ssh-keygen -t rsa 在第一个提示处按回车键以使用默认文件位置。接下来,输入密钥的安全密码。


Every time I want to commit the command "git push heroku master" I am asked in the PowerShell to enter the credentials. When I enter heroku credentials (which is connected to git by default) I get the error message.

But, when I type the credetials contained in the netrc file in my home directory, then the thing functions. The password is however hashed in my opinion. How can I avoid entering credentials every time I want to push changes to git?

UPDATE:

PS C:\Users\Dragan\heroku_workspace\python-getting-started> git push heroku master
github --credentials get: github: command not found
Username for 'https://git.heroku.com': my-email@hotmail.com
Password for 'https://my-email@hotmail.com@git.heroku.com':
github --credentials erase: github: command not found
remote: !       WARNING:
remote: !       Do not authenticate with username and password using git.
remote: !       Run `heroku login` to update your credentials, then retry the git command.
remote: !       See documentation for details: Https://devcenter.heroku.com/articles/http-git#authentication
fatal: Authentication failed for 'https://git.heroku.com/mysterious-river-71834.git/'

解决方案

A common mistake is cloning using the default (HTTPS) instead of SSH. You can correct this by going to your repository, clicking the ssh button left to the URL field and updating the URL of your origin remote like this:
git remote set-url origin git@github.com:username/repo.git

or if your repository already then click green button CLONE OR DOWNLOAD and select use SSH

Enable SSH authentication

$ heroku create --ssh-git

Redirect tall HTTPS calls to SSH ( If you want to always use SSH Git with Heroku on a particular machine)

$ git config --global url.ssh://git@heroku.com/.insteadOf https://git.heroku.com/

To generate a public key:

ssh-keygen -t rsa Press enter at the first prompt to use the default file location. Next, type a secure passphrase for the key.

这篇关于推动更改Git不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆