我能够通过HTTPS身份验证克隆此repo的副本.我做了一些提交,想要推回到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
alis@github.com/derekerdmann/lunch_call.git/info/refs
fatal: HTTP request failed
Run Code Online (Sandbox Code Playgroud)
同时使用详细模式进行设置.我还是很困惑.
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 …Run Code Online (Sandbox Code Playgroud) 我正在使用几个存储库,但最近我只是在内部工作,一切都很棒.
今天我不得不承诺并将代码推送到其他代码中,但我遇到了一些麻烦.
$ git push appharbor master
error: The requested URL returned error: 403 while accessing https://gavekortet@appharbor.com/mitivo.git/info/refs?service=git-receive-pack
fatal: HTTP request failed
Run Code Online (Sandbox Code Playgroud)
我无能为力,这将再次带来密码输入.
如何重置系统上的凭据,以便Git会询问我该存储库的密码?
我试过了:
git config --global --unset core.askpass为了取消设置密码
git config credential.helper 'cache --timeout=1'为了避免凭证缓存......
似乎没有任何作用; 有没有人有更好的主意?
我遇到了一个最近的问题,它适用于我创建的任何新的GitHub组织.
我是两个相当成熟的GitHub组织的管理员.我可以在其中创建回购,一切都"正常".(SmartGit,和CLI Git,OSX).
但是,如果我创建一个新组织,我不能Push,它会收到403错误:
$ git push
remote: Permission to [org]/[repo].git denied to [username].
fatal: unable to access 'https://github.com/[org]/[repo].git/':
The requested URL returned error: 403
$
Run Code Online (Sandbox Code Playgroud)
重现步骤:
我可以通过GitHub.com网页界面进行(并提交)更改,但我不能将它们从我的本地仓库中推出.
注意:在不同的PC上,我可以推送到现有组织中,而不是新组织.另一台PC仍然是Mac,所以它可能与钥匙链有关.好的,我已经从Windows VM测试过它,但它仍然失败了.所以,它看起来像GitHub端的东西.
有什么建议?
我有一个公共 github 存储库(我几年前创建的)。我启用了两因素身份验证。我想创建一个 github API 令牌,以便能够将一些更改推送到我的存储库。
我必须在 github“新个人访问令牌”页面中选择的最小范围集是什么才能将更改推送到此存储库?
我想避免赋予令牌任何不必要的权利。
我无法通过 HTTPS 和 SSH 推送(但拉取工作正常)到我公司的 git 存储库,并且非常感谢这方面的任何帮助。这是一个与这里看到的类似的问题:(Git 著名的“错误:对 .git 的权限被拒绝给用户”)除了我正在推送到公司回购而不是个人回购 - 想知道这是否可能有什么事情要做有公司防火墙。
这是我所做的(在已经克隆了 repo 之后):
git remote set-url origin [SSH url of my company repo]
Run Code Online (Sandbox Code Playgroud)
设置我的 ssh 密钥并将其添加到我的用户帐户中;ssh 到 git@github.com 给了我权限被拒绝(公钥),但 ssh 到 git@git.soma.company.com 认证成功。
git pull
git push origin master
Run Code Online (Sandbox Code Playgroud)
这给了我:
错误:对用户的组织/repo.git 权限被拒绝。致命:远端意外挂断
git remote set-url origin [HTTPS url of my company repo]
git pull
git push origin master
Run Code Online (Sandbox Code Playgroud)
这提示我输入用户名和密码,然后给我:
错误:无法访问 URL [HTTPS url of my company repo],返回代码 22 致命:git-http-push failed
这是我的 .git/config …
我有 2 个 github 帐户 X(专业帐户)和 Y(个人帐户)。
在我的个人计算机上,我使用了这两个帐户和 Visual Code。
但现在,当我尝试将一些更改推送到我的存储库时,我收到一条消息:
X 拒绝对 Y/repo.git 的权限。
这是与此重复的,但那里的答案对我不起作用。
我试过 :
git config --global user.email "email@example.com"
没用。我尝试不使用--global,但没有成功。
我也看到了这个答案,但我不知道如何“取消黑名单”文件。无论如何,我什至找不到我的.gitconfig。
我失去了耐心和希望,如果有人有解决方案,我将非常感谢分享!
git ×5
github ×5
credentials ×1
dvcs ×1
permissions ×1
push ×1
settings ×1
smartgit ×1
ubuntu ×1
windows ×1