提问人:Hamza Bilal 提问时间:11/1/2023 最后编辑:kometenHamza Bilal 更新时间:11/5/2023 访问量:45
当我在 Github 中推送我的代码时,Ubuntu 会出现远程权限错误
When I push my code in Github then remote permission error comes in Ubuntu
问:
当我在 Github 中推送我的代码时,Ubuntu 中会出现远程权限错误。 我想在我的 Github 存储库中推送我的代码,但出现此错误
hamza@hamza-HP-EliteBook-840-G1:~/PycharmProjects/pythonProject/chat-website$ git init
Reinitialized existing Git repository in /home/hamza/PycharmProjects/pythonProject/chat-website/.git/
hamza@hamza-HP-EliteBook-840-G1:~/PycharmProjects/pythonProject/chat-website$ git status
On branch main
Your branch is based on 'origin/main', but the upstream is gone.
(use "git branch --unset-upstream" to fixup)
nothing to commit, working tree clean
hamza@hamza-HP-EliteBook-840-G1:~/PycharmProjects/pythonProject/chat-website$ git init
Reinitialized existing Git repository in /home/hamza/PycharmProjects/pythonProject/chat-website/.git/
hamza@hamza-HP-EliteBook-840-G1:~/PycharmProjects/pythonProject/chat-website$ git status
On branch main
Your branch is based on 'origin/main', but the upstream is gone.
(use "git branch --unset-upstream" to fixup)
nothing to commit, working tree clean
hamza@hamza-HP-EliteBook-840-G1:~/PycharmProjects/pythonProject/chat-website$ git add .
hamza@hamza-HP-EliteBook-840-G1:~/PycharmProjects/pythonProject/chat-website$ git status
On branch main
Your branch is based on 'origin/main', but the upstream is gone.
(use "git branch --unset-upstream" to fixup)
nothing to commit, working tree clean
hamza@hamza-HP-EliteBook-840-G1:~/PycharmProjects/pythonProject/chat-website$ git push -u origin main
remote: Permission to hamzaabialal/chat-website.git denied to hamzbialal.
fatal: unable to access 'https://github.com/hamzaabialal/chat-website.git/': The requested URL returned errorlike so
: 403
hamza@hamza-HP-EliteBook-840-G1:~/PycharmProjects/pythonProject/chat-website$
答:
1赞
Farhad85
11/1/2023
#1
若要解决此问题,可以执行以下任一操作:
- 添加与远程 URL 匹配的默认主机;
- 使用 git remote set-url 命令设置远程 URL;
- 将文件更新为主机中的某个 URL。
.git/config
评论