推送到 Git 返回错误代码 403 fatal:HTTP 请求失败
我能够通过 HTTPS 身份验证克隆此存储库的副本。我已经进行了一些提交,并希望将其推回 GitHub 服务器。在 Windows 7 x64 上使用 Cygwin。
C:\cygwin\home\XPherior\Code\lunch_call>git push
Password:
error: The requested URL returned error: 403 while accessing https://MichaelDrog
[email protected]/derekerdmann/lunch_call.git/info/refs
fatal: HTTP request failed
还可以将其设置为详细模式。我还是很困惑。
C:\cygwin\home\XPherior\Code\lunch_call>set GIT_CURL_VERBOSE=1
C:\cygwin\home\XPherior\Code\lunch_call>git push
Password:
* Couldn't find host github.com in the _netrc file; using defaults
* About to connect() to github.com port 443 (#0)
* Trying 207.97.227.239... * 0x23cb740 is at send pipe head!
* Connected to github.com (207.97.227.239) port 443 (#0)
* successfully set certificate verify locations:
* CAfile: C:\Program Files (x86)\Git/bin/curl-ca-bundle.crt
CApath: none
* SSL connection using AES256-SHA
* Server certificate:
* subject: 2.5.4.15=Private Organization; 1.3.6.1.4.1.311.60.2.1.3=US; 1.
3.6.1.4.1.311.60.2.1.2=California; serialNumber=C3268102; C=US; ST=California; L
=San Francisco; O=GitHub, Inc.; CN=github.com
* start date: 2011-05-27 00:00:00 GMT
* expire date: 2013-07-29 12:00:00 GMT
* subjectAltName: github.com matched
* issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert High Ass
urance EV CA-1
* SSL certificate verify ok.
> GET /derekerdmann/lunch_call.git/info/refs?service=git-receive-pack HTTP/1.1
User-Agent: git/1.7.4.3282.g844cb
Host: github.com
Accept: */*
Pragma: no-cache
< HTTP/1.1 401 Authorization Required
< Server: nginx/1.0.4
< Date: Thu, 15 Sep 2011 22:44:41 GMT
< Content-Type: text/plain
< Connection: keep-alive
< Content-Length: 55
< WWW-Authenticate: Basic realm="GitHub"
<
* Ignoring the response-body
* Expire cleared
* Connection #0 to host github.com left intact
* Issue another request to this URL: 'https://[email protected]/dereker
dmann/lunch_call.git/info/refs?service=git-receive-pack'
* Couldn't find host github.com in the _netrc file; using defaults
* Re-using existing connection! (#0) with host github.com
* Connected to github.com (207.97.227.239) port 443 (#0)
* 0x23cb740 is at send pipe head!
* Server auth using Basic with user 'MichaelDrogalis'
> GET /derekerdmann/lunch_call.git/info/refs?service=git-receive-pack HTTP/1.1
Authorization: Basic XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
User-Agent: git/1.7.4.3282.g844cb
Host: github.com
Accept: */*
Pragma: no-cache
< HTTP/1.1 401 Authorization Required
< Server: nginx/1.0.4
< Date: Thu, 15 Sep 2011 22:44:41 GMT
< Content-Type: text/plain
< Connection: keep-alive
< Content-Length: 55
* Authentication problem. Ignoring this.
< WWW-Authenticate: Basic realm="GitHub"
* The requested URL returned error: 401
* Closing connection #0
* Couldn't find host github.com in the _netrc file; using defaults
* About to connect() to github.com port 443 (#0)
* Trying 207.97.227.239... * 0x23cb740 is at send pipe head!
* Connected to github.com (207.97.227.239) port 443 (#0)
* successfully set certificate verify locations:
* CAfile: C:\Program Files (x86)\Git/bin/curl-ca-bundle.crt
CApath: none
* SSL re-using session ID
* SSL connection using AES256-SHA
* old SSL session ID is stale, removing
* Server certificate:
* subject: 2.5.4.15=Private Organization; 1.3.6.1.4.1.311.60.2.1.3=US; 1.
3.6.1.4.1.311.60.2.1.2=California; serialNumber=C3268102; C=US; ST=California; L
=San Francisco; O=GitHub, Inc.; CN=github.com
* start date: 2011-05-27 00:00:00 GMT
* expire date: 2013-07-29 12:00:00 GMT
* subjectAltName: github.com matched
* issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert High Ass
urance EV CA-1
* SSL certificate verify ok.
* Server auth using Basic with user 'MichaelDrogalis'
> GET /derekerdmann/lunch_call.git/info/refs HTTP/1.1
Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
User-Agent: git/1.7.4.3282.g844cb
Host: github.com
Accept: */*
Pragma: no-cache
* The requested URL returned error: 403
* Expire cleared
* Closing connection #0
error: The requested URL returned error: 403 while accessing https://MichaelDrog
[email protected]/derekerdmann/lunch_call.git/info/refs
fatal: HTTP request failed
这些是我拥有的 git 和 curl 版本:
C:\Users\XPherior>git --version
git version 1.7.4.msysgit.0
C:\Users\XPherior>curl --version
curl 7.21.7 (amd64-pc-win32) libcurl/7.21.7 OpenSSL/0.9.8r zlib/1.2.5
Protocols: dict file ftp ftps gopher http https imap imaps ldap pop3 pop3s rtsp
smtp smtps telnet tftp
Features: AsynchDNS GSS-Negotiate Largefile NTLM SSL SSPI libz
I was able to clone a copy of this repo over HTTPS authenticated. I've made some commits and want to push back out to the GitHub server. Using Cygwin on Windows 7 x64.
C:\cygwin\home\XPherior\Code\lunch_call>git push
Password:
error: The requested URL returned error: 403 while accessing https://MichaelDrog
[email protected]/derekerdmann/lunch_call.git/info/refs
fatal: HTTP request failed
Also set it up with verbose mode. I'm still pretty baffled.
C:\cygwin\home\XPherior\Code\lunch_call>set GIT_CURL_VERBOSE=1
C:\cygwin\home\XPherior\Code\lunch_call>git push
Password:
* Couldn't find host github.com in the _netrc file; using defaults
* About to connect() to github.com port 443 (#0)
* Trying 207.97.227.239... * 0x23cb740 is at send pipe head!
* Connected to github.com (207.97.227.239) port 443 (#0)
* successfully set certificate verify locations:
* CAfile: C:\Program Files (x86)\Git/bin/curl-ca-bundle.crt
CApath: none
* SSL connection using AES256-SHA
* Server certificate:
* subject: 2.5.4.15=Private Organization; 1.3.6.1.4.1.311.60.2.1.3=US; 1.
3.6.1.4.1.311.60.2.1.2=California; serialNumber=C3268102; C=US; ST=California; L
=San Francisco; O=GitHub, Inc.; CN=github.com
* start date: 2011-05-27 00:00:00 GMT
* expire date: 2013-07-29 12:00:00 GMT
* subjectAltName: github.com matched
* issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert High Ass
urance EV CA-1
* SSL certificate verify ok.
> GET /derekerdmann/lunch_call.git/info/refs?service=git-receive-pack HTTP/1.1
User-Agent: git/1.7.4.3282.g844cb
Host: github.com
Accept: */*
Pragma: no-cache
< HTTP/1.1 401 Authorization Required
< Server: nginx/1.0.4
< Date: Thu, 15 Sep 2011 22:44:41 GMT
< Content-Type: text/plain
< Connection: keep-alive
< Content-Length: 55
< WWW-Authenticate: Basic realm="GitHub"
<
* Ignoring the response-body
* Expire cleared
* Connection #0 to host github.com left intact
* Issue another request to this URL: 'https://[email protected]/dereker
dmann/lunch_call.git/info/refs?service=git-receive-pack'
* Couldn't find host github.com in the _netrc file; using defaults
* Re-using existing connection! (#0) with host github.com
* Connected to github.com (207.97.227.239) port 443 (#0)
* 0x23cb740 is at send pipe head!
* Server auth using Basic with user 'MichaelDrogalis'
> GET /derekerdmann/lunch_call.git/info/refs?service=git-receive-pack HTTP/1.1
Authorization: Basic XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
User-Agent: git/1.7.4.3282.g844cb
Host: github.com
Accept: */*
Pragma: no-cache
< HTTP/1.1 401 Authorization Required
< Server: nginx/1.0.4
< Date: Thu, 15 Sep 2011 22:44:41 GMT
< Content-Type: text/plain
< Connection: keep-alive
< Content-Length: 55
* Authentication problem. Ignoring this.
< WWW-Authenticate: Basic realm="GitHub"
* The requested URL returned error: 401
* Closing connection #0
* Couldn't find host github.com in the _netrc file; using defaults
* About to connect() to github.com port 443 (#0)
* Trying 207.97.227.239... * 0x23cb740 is at send pipe head!
* Connected to github.com (207.97.227.239) port 443 (#0)
* successfully set certificate verify locations:
* CAfile: C:\Program Files (x86)\Git/bin/curl-ca-bundle.crt
CApath: none
* SSL re-using session ID
* SSL connection using AES256-SHA
* old SSL session ID is stale, removing
* Server certificate:
* subject: 2.5.4.15=Private Organization; 1.3.6.1.4.1.311.60.2.1.3=US; 1.
3.6.1.4.1.311.60.2.1.2=California; serialNumber=C3268102; C=US; ST=California; L
=San Francisco; O=GitHub, Inc.; CN=github.com
* start date: 2011-05-27 00:00:00 GMT
* expire date: 2013-07-29 12:00:00 GMT
* subjectAltName: github.com matched
* issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert High Ass
urance EV CA-1
* SSL certificate verify ok.
* Server auth using Basic with user 'MichaelDrogalis'
> GET /derekerdmann/lunch_call.git/info/refs HTTP/1.1
Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
User-Agent: git/1.7.4.3282.g844cb
Host: github.com
Accept: */*
Pragma: no-cache
* The requested URL returned error: 403
* Expire cleared
* Closing connection #0
error: The requested URL returned error: 403 while accessing https://MichaelDrog
[email protected]/derekerdmann/lunch_call.git/info/refs
fatal: HTTP request failed
These are the versions of git and curl that I have:
C:\Users\XPherior>git --version
git version 1.7.4.msysgit.0
C:\Users\XPherior>curl --version
curl 7.21.7 (amd64-pc-win32) libcurl/7.21.7 OpenSSL/0.9.8r zlib/1.2.5
Protocols: dict file ftp ftps gopher http https imap imaps ldap pop3 pop3s rtsp
smtp smtps telnet tftp
Features: AsynchDNS GSS-Negotiate Largefile NTLM SSL SSPI libz
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(30)
对肖恩的回答的一点补充。
您可以使用 git remote set-url 命令,而不是手动编辑 .git/config 文件。
在你的情况下,它应该是:
我发现它比乱搞点文件更容易和更干净。
One small addition to Sean's answer.
Instead of editing
.git/config
file manually, you can usegit remote set-url
command.In your case it should be:
I find it easier and cleaner, than messing around with dot-files.
编辑存储库目录下的
.git/config
文件在
[remote "origin"]
部分下查找url=
条目将其从
url 更改=https://github.com/rootux/my-repo.git
到https://[电子邮件受保护]/rootux/my- repo.git
其中
USERNAME
是你的 github 用户名Edit
.git/config
file under your repo directoryFind
url=
entry under section[remote "origin"]
Change it from
url=https://github.com/rootux/my-repo.git
tohttps://[email protected]/rootux/my-repo.git
where
USERNAME
is your github user name其他建议切换到 SSH 的答案有点没有抓住重点。支持 HTTPS,但您必须使用 GITHUB 密码登录,而不是 SSH 密码(这正是给我带来同样错误的原因)。
我遇到了同样的问题,但确保在终端密码提示符处使用我的实际 GitHub 密码修复了解决方案,无需更改配置或诉诸 SSH。
值得注意的是,许多公共机构(例如我的学校)会阻止 SSH,但允许 HTTPS(这是我首先开始通过 HTTPS 进行克隆的唯一原因)。
希望能帮助其他遇到同样问题的人...
The other answers that suggest switching to SSH sort of miss the point. HTTPS is supported, but you must log in with you GITHUB password, not your SSH passphrase (which was what was giving me the same exact error).
I was having the same problem, but making sure to use my actual GitHub password at the terminal password prompt fixed the solution with no alteration to the config, or resorting to SSH.
The reason it is important to note this, is many public institutions (such as my school) will block SSH, but allow HTTPS (which is the only reason I started cloning over HTTPS in the first place).
Hope that helps anyone else having the same issue...
如果您使用的是 Windows,有时可能会发生这种情况,因为 Windows 将外部存储库(在我们的示例中为 github)的凭据存储在其自己的存储中。那里保存的凭据可能与您现在需要的凭据不同。
因此,为了避免这个问题,只需在这个存储中找到 github 并删除保存的凭据即可。此后,在推送时 git 将请求您的凭据并允许您推送。
If you are using windows, sometimes this may happen because Windows stores credentials for outer repo (in our case github) in its own storage. And credentials that saved there can be different from those you need right now.
So to avoid this problem, just find github in this storage and delete saved credentials. After this, while pushing git will request your credentials and will allow you to push.
在 Mac OS X 上出现同样的错误和解决方案。
一切都工作正常,直到我在 GitHub 上创建新帐户并尝试推送
并收到错误:
远程:权限NEWUSER/NEWREPO.git 被 OLDUSER 拒绝。致命:无法访问 'https://github.com/NEWUSER/NEWREPO.git/ ': 请求的 URL 返回错误:403
它应该通过为全局或当前存储库设置 user.name 来修复,
但事实并非如此。
我通过从“密码”部分下的“钥匙串访问”应用中删除与 GitHub 关联的 OLDUSER 来修复此问题。然后push命令就成功了。
参考
Same error and resolution on Mac OS X.
Everything was working fine till I created a new account on GitHub and tried to push
And got the error:
remote: Permission to NEWUSER/NEWREPO.git denied to OLDUSER. fatal: unable to access ‘https://github.com/NEWUSER/NEWREPO.git/': The requested URL returned error: 403
It should have fixed by setting the user.name either for global or current repo
But it didn’t.
I got it fixed by deleting the OLDUSER associated with GitHub from Keychain Access app under Passwords section. Then the push command went successful.
reference
这对我有用 -:
希望有帮助
This works for me -:
Hope it helps
这里有很多答案,但这就是解决我的问题的方法。
自 2020 年 7 月起,您必须使用
所以你必须 在您的个人资料设置页面中生成访问令牌并将其用作您的密码。选中写入存储库所需的框。
现在使用以下命令将您的用户名添加到存储库:
当您尝试推送时,它会询问您的密码。 输入您新生成的令牌。
如果您在推送时仍然遇到问题,请使用网络界面将其分叉为个人存储库,以隔离任何权限问题。您将能够专注于解决身份验证问题。
A lot of answers here, but this is what solved my problem.
Since July 2020 you must use Token authentication to access GitHub if you are using HTTPS.
So you must generate an access token in your profile settings page and use it as your password. Check the boxes necessary to write to the repository.
Now add your username to the repo with this command:
When you try to push, it will ask for your password. Enter your newly generated token.
If you are still having trouble pushing, use the web interface to fork it as a personal repo to isolate any permission problem. You'll be able to focus on solving the auth problem.
我认为@deepwaters 对于旧版本的答案是正确的。 HTTPS URL 需要有用户名。我有 git 1.7.0.4 并且 git push origin master 甚至不会要求输入密码,直到我添加它。
I think @deepwaters got the answer correct for older versions. The HTTPS URL needs to have the username. I had git 1.7.0.4 and
git push origin master
wouldn't even ask for a password till I added it.升级你的git。 GitHub 已在 https://help.github.com/articles/ 回答了这个问题错误-请求的网址-返回错误-403。
Upgrade your git. GitHub has answered this question at https://help.github.com/articles/error-the-requested-url-returned-error-403.
403 代码是“禁止”。服务器看到您的请求并拒绝了它。您是否有权推送到该存储库?
A 403 code is "Forbidden". The server saw your request and refused it. Do you have permission to push to that repository?
想通了。我通过 HTTPS 克隆。设置我的公共 SSH 密钥、通过 SSH 克隆以及通过 SSH 推送修复了该问题。
Figured it out. I cloned over HTTPS. Setting up my public SSH keys, cloning over SSH, and pushing over SSH fixed it.
执行此操作以进行临时修复
git push -u https://username:[email ;受保护]/用户名/repo_name.git大师
Do this for a temporary fix
git push -u https://username:[email protected]/username/repo_name.git master
我遇到了同样的错误,原因很愚蠢 - 我没有权限提交到选定的存储库。我不知道我必须
如 https://help.github.com/categories/63/articles
I faced the same error and the cause was stupid - I did not have privileges to commit to selected repository. I did not know that I have to
as described in https://help.github.com/categories/63/articles
实际上我对此有一个非常简单的解决方法。我所做的只是在克隆存储库后以不同的方式编辑 git 配置文件。远程源 URL 是您需要在默认 config 文件中编辑的内容。它应该如下所示
I actually had a very simple fix to this. All i did was edit the git config file differently after cloning the repository. The remote origin url is what you need to edit in your default config file. It should look like seen below
在此之后,我们的“推送到 Git”开始工作美好的。
After this our "Push to Git" worked fine.
将其从 更改
为
它有效!
不要忘记“@”之前的“git”。
change it from
to
It works!
Do not forget the "git" before the "@".
只需将您的用户名添加到网址中,如下所示:
https://[电子邮件受保护]/islam9/bootstrap-rtl
请检查:
http: //islamkhalil.wordpress.com/2012/12/06/github-error-pushing-to-git-returning-error-code-403-fatal/
Just add you username into url like this :
https://[email protected]/islam9/bootstrap-rtl
please check:
http://islamkhalil.wordpress.com/2012/12/06/github-error-pushing-to-git-returning-error-code-403-fatal/
下面是解决方案
对于 Windows,您可以在此处找到按键:
控制面板 >用户帐户>凭证管理器> Windows 凭据 >通用凭据
接下来,删除 Github 密钥。
在 Mac 中
1-在 Finder 中,搜索“钥匙串访问”应用。
2在“钥匙串访问”中,搜索 github.com。
3-找到 github.com 的“互联网密码”条目。
4-相应地编辑或删除条目。
Below is the solution
For Windows you can find the keys here:
control panel > user accounts > credential manager > Windows credentials > Generic credentials
Next, remove the Github keys.
In mac
1-In Finder, search for the Keychain Access app.
2In Keychain Access, search for github.com.
3-Find the "internet password" entry for github.com.
4-Edit or delete the entry accordingly.
对于那些在使用ssh时遇到权限被拒绝403错误的人(根据Xiao) 或 http 网址
尝试这些命令
使用管理员权限
For those having permission denied 403 error while using ssh(according to Xiao) or http urls
try these commands
with administrator rights
上述答案均不适用于我的企业 GitHub 帐户。按照以下步骤通过 ssh 密钥生成方式进行推送。
通过访问您的 git 帐户创建一个存储库。
生成 ssh 密钥:
将文件 ~/.ssh/id_rsa.pub 的内容复制到 GitHub 帐户设置中的 SSH 密钥。
测试 SSH 密钥:
现在 cd 到您的 git 克隆文件夹并执行:
现在尝试编辑文件(尝试自述文件),然后执行:
更新:新的 git 版本似乎建议在创建新存储库时不要有任何文件。因此创建一个空白仓库。
None of the above answers worked for my
enterprise
GitHub account. Follow these steps for pushing via ssh key generation way.Create a repo by visiting your git account.
Generate ssh key:
Copy the contents of the file ~/.ssh/id_rsa.pub to your SSH keys in your GitHub account settings.
Test SSH key:
Now cd to your git clone folder and do:
Now try editing a file (try the README) and then do:
Update: new git version seems to recommend not to have any file while new repo is created. Hence make aa blank repo.
如果您在 github 上遇到 403 错误,
请务必在创建令牌时选中所有复选框:
https://github.com/settings/令牌
我认为 github 令牌生成页面有设计缺陷。
if you get 403 error with github,
sure to check all checkboxs when create token:
https://github.com/settings/tokens
i think github token generate page has design flaw.
我遇到了类似的问题,大多数答案在我的情况下不起作用,我收到了权限被拒绝 403 禁止错误。以下步骤帮助我解决了问题:
如果安装了brew,请通过以下命令安装git CLI:
参考安装git CLI https://github.com/cli/cli#installation
然后运行
它会问你以下问题,回答如下,
它会为你生成代码,输入生成的代码在浏览器中进行身份验证。
通过执行上述步骤,您将能够将代码
推送
到您的存储库。I faced similar issue and most of the answer did not work in my case, i was getting permission denied 403 forbidden error. Following steps helped me to resolve the issue:
Install git CLI by below command if you have brew installed:
Reference to install git CLI https://github.com/cli/cli#installation
then run
it will ask you following questions, answer like this,
It will generate code for you, enter generated to code your browser for authentication.
By following above steps you will be able to
push
code to your repository.对我有用的:
我的存储库是一个分叉,并且仍然链接到父存储库。
会告诉你这是否是你的回购协议。
允许您将其重新配置到您的存储库,然后允许您推送。
What worked for me:
My repo was a fork and still linked to the the parents repo.
Will tell you if it is your repo or not.
Allows you to reconfigure it to your repo and then allow you to push.
如果由于某种原因不允许 SSH,HTTPS 也可以。
要通过HTTPS推送提交,您应该使用个人访问令牌 并确保读写在定义的
范围
中可用个人令牌的访问权限。在GitHub中设置如下。
If SSH is not allowed for some reason, HTTPS is also ok.
To push the commits by HTTPS, you should use the personal access token and make sure the read and write is available in
Scopes
which define the access for personal tokens.Setting in GitHub as follows.
对于任何好奇的人,我的 mac 机器与 lucid vm 运行 git 1.7.6 与 1.7.0.4,并且可以从我的 mac(较新的 git)推送完全相同的存储库,但不能从 VM
相同的curl 版本。也许某些较旧的 git 版本不支持 https 推送?
For anyone curious, my mac machine vs lucid vm ran git 1.7.6 vs 1.7.0.4, and the exact same repo was pushable from my mac (newer git) but not the VM
Same curl version. Perhaps some older git versions don't support https pushes?
添加用户名作为 URL 的一部分,发生此错误是因为 git 命令点击的是 http 而不是 https。因此设置 url
之后系统将提示您输入密码:
Add the user name as part of the URL and This error happens because the git command is hitting http instead of https. So set the url
After which you will be prompted for password:
使用管理员权限尝试以下命令。这个命令解决了我的问题。希望它能解决您的问题。
Try below command using administrator permission. This command solved my issue. Hope it will resolve your problem.
我想出了这个问题的我自己的变体。
问题不是将协议从 https 更改为 ssl,而是,
设置 Github 全局用户名和电子邮件! (我试图推动
私人存储库。
I figured out my own variation of this problem.
The issue was not changing the protocol from https to ssl, but instead,
setting the Github global username and email! (I was trying to push to a
private repository.
我刚刚遇到了同样的问题,并找出原因。
Github似乎只支持ssh方式读写repo,尽管https方式也显示“Read&Write”。
因此,您需要将 PC 上的存储库配置更改为 ssh 方式:
.git/config
文件。[remote "origin"]
部分下查找url=
条目。url=https://[电子邮件受保护]/derekerdmann/lunch_call.git
至:
url=ssh://[电子邮件受保护]/derekerdmann/ Lunch_call.git
即,将
@
符号之前的所有文本更改为ssh://git
config
文件并退出。现在您可以使用 git push origin master 来同步 GitHub 上的存储库。I just got the same problem and just figured out what's cause.
Github seems only supports ssh way to read&write the repo, although https way also displayed 'Read&Write'.
So you need to change your repo config on your PC to ssh way:
.git/config
file under your repo directory.url=
entry under section[remote "origin"]
.url=https://[email protected]/derekerdmann/lunch_call.git
to:
url=ssh://[email protected]/derekerdmann/lunch_call.git
That is, change all the texts before
@
symbol tossh://git
config
file and quit. now you could usegit push origin master
to sync your repo on GitHub.为了确保能够使用
https
协议登录,您应该首先将您的身份验证凭据设置为 git 远程 URI:然后系统会询问您尝试 git push 时需要密码。
其实这是关于http认证格式的。你也可以设置一个密码:
你应该知道,如果你这样做,你的 github 密码将以明文形式存储在你的 .git 目录中,这显然是不可取的。
To definitely be able to login using
https
protocol, you should first set your authentication credential to the git Remote URI:Then you'll be asked for a password when trying to
git push
.In fact, this is on the http authentication format. You could set a password too:
You should be aware that if you do this, your github password will be stored in plaintext in your .git directory, which is obviously undesirable.