Git:git push 时 remote: No anonymous write access. fatal: Authentication failed for ....问题
git push 过程中遇到:remote: No anonymous write access.fatal: Authentication failed for …其中一个较简单的解决办法:先在个人github页面的Settings → Developer settings → Personal access tokens → Generate a personal access token,生
·
git push 过程中遇到:
remote: No anonymous write access.
fatal: Authentication failed for …
最初使用了不正确的解决办法:
- 先在个人github页面的Settings → Developer settings → Personal access tokens → Generate a personal access token,生成令牌
- 在项目的命令行中输入
git remote set-url origin https://令牌串@github.com/个人用户名/项目名.git
- 再次git push ,不再报 No anonymous write access错误
但是,这时git提交的代码到了个人自己的git项目中,即提交到https://令牌串@github.com/个人用户名/项目名.git中。而在协同开发时,我需要将代码提交至目的项目而非自己的项目。
经过大佬指导,最后解决了问题,正解如下:
-
先在个人github页面的Settings → Developer settings → Personal access tokens → Generate a personal access token,生成令牌
-
在git bash命令行中输入
git push
,等待弹出窗口
-
第一个窗口输入个人的github账户(用户名),第二个窗口输入刚刚生成的令牌。输入正确后push成功。
更多推荐
已为社区贡献1条内容
所有评论(0)