ERROR: Permission to Splode/pomotroid.git deni

在向分支 feat/about-page上传代码时

bash 复制代码
git push -u origin feat/about-page

出现ERROR: Permission to Splode/pomotroid.git deni错误

原因 :- 你用的账号是 eleven-h,但这个仓库属于用户 Splode- 你没有权限向这个仓库推送代码。

解决:切换远程仓库为自己的 Fork

我意识到问题后,删除了原来的远程仓库配置,并添加了自己的 Fork:

bash 复制代码
git remote remove origin
git remote add origin git@github.com:Liar0320/pomotroid.git
  • 现在远程仓库变成了我自己的 Fork:Liar0320/pomotroid.git

接着我拉取了远程信息:

bash 复制代码
git fetch
From github.com:Liar0320/pomotroid
* [new branch] feat/about-page -> origin/feat/about-page
* [new branch] feat/exercise-reminder ...
  • 成功获取了远程仓库的所有分支信息。

📤 推送本地分支到自己 Fork 的远程仓库

此时我再次查看本地分支:

bash 复制代码
git branch
* feat/about-page
feat/main-view-redesign
feat/settings-interaction
feat/timer-settings-layout
master

提示当前分支没有设置上游分支:

bash 复制代码
git push
fatal: The current branch feat/about-page has no upstream branch.

于是我设置了上游分支并推送成功:

bash 复制代码
git push --set-upstream origin feat/about-page
Enumerating objects: 96, done.

...

Branch 'feat/about-page' set up to track remote branch 'feat/about-page' from 'origin'.
  • 这表示我已经成功将本地的 feat/about-page 分支推送到远程,并建立了跟踪关系。
  • 以后可以直接使用 git pushgit pull 操作该分支。

🧾 最后查看提交历史

bash 复制代码
git log
相关推荐
wdfk_prog14 小时前
`git rm --cached`:如何让文件“脱离”版本控制
大数据·linux·c语言·笔记·git·学习·elasticsearch
Mark_Aussie15 小时前
本地项目上传到Git仓库
git
骚饼19 小时前
Git 命令配置别名、Git命令缩写(Mac版)
前端·git
SStone_TJ2 天前
【常用的git命令】
git
没有鸡汤吃不下饭2 天前
Git将某个分支合并到开发(dev)、测试(test)后突然想撤销该分支的功能,怎么处理?
前端·git·github
康一夏2 天前
git fatal:Server aborted the SSL handshake
git·网络协议·ssl
Vio7252 天前
在IntelliJ IDEA中使用Git
git
Net_Walke2 天前
git 的常用命令
git·物联网·github·iot
L X..3 天前
Git 无法访问 GitHub(Recv failure: Connection was reset)问题解决教程
git·github
建群新人小猿3 天前
客户标签自动管理:标签自动化运营,画像持久保鲜
android·java·大数据·前端·git