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
相关推荐
HuaCode27 分钟前
Openclaw一键安装部署(2026年4月最新)
git·python·nodejs·openclaw·api token
小比特_蓝光4 小时前
版本控制器Git/调试器gdb/cgdb使用
git
海参崴-5 小时前
Git使用完全指南
git
Jp7gnUWcI5 小时前
AI Compose Commit:用 AI 智能重构 Git 提交工作流
人工智能·git·重构
小柯博客5 小时前
从零开始打造 OpenSTLinux 6.6 Yocto 系统 - STM32MP2(基于STM32CubeMX)(八)
c语言·git·stm32·单片机·嵌入式硬件·嵌入式·yocto
eastyuxiao14 小时前
如何在不同的机器上运行多个OpenClaw实例?
人工智能·git·架构·github·php
bu_shuo16 小时前
git练习学习网站【中文网站】
git·学习
秃秃然然17 小时前
Git指北
git
适应规律21 小时前
Git笔记
笔记·git
csdn_aspnet1 天前
Git二分法精准定位Bug,分享用git bisect快速锁定引入缺陷的提交,提升调试效率
git·bug·二分查找