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
相关推荐
wxr06161 小时前
GIT学习
git·学习
猫头虎3 小时前
2026最新|GitHub 启用双因素身份验证 2FA 教程:TOTP.app 一键生成动态验证码(新手小白图文实操)
git·开源·gitlab·github·开源软件·开源协议·gitcode
爱学英语的程序员4 小时前
让AI 帮我做了个个人博客(附提示词!)
人工智能·git·vue·github·node·个人博客
liu****5 小时前
git工具
git·python·算法·机器学习·计算机基础
wxr06166 小时前
git无法克隆
git
cooldream20098 小时前
Git 拒绝推送(Push Rejected)问题全解析与解决方案实战指南
git
wxr06168 小时前
GIT无法push
git·gitee
装不满的克莱因瓶10 小时前
【踩坑】IDEA提交Git .gitignore忽略文件不起作用
java·git·.gitignore·踩坑
cos20 小时前
Fork 主题如何更新?基于 Ink 构建主题更新 CLI 工具
前端·javascript·git
OpenMiniServer21 小时前
当 AI 成为 Git 里的一个“人”
人工智能·git