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
相关推荐
深海鱼在掘金4 天前
Git 完全指南 —— 第1章:Git 概览与版本控制演进
git
noravinsc4 天前
关于Git Flow
git
蜜獾云5 天前
在Git中配置用户名和密码
git
scx_link5 天前
通过git bash在本地创建分支,并推送到远程仓库中
开发语言·git·bash
南大白5 天前
IntelliJ IDEA 运行时的 JVM 本地内存溢出崩溃
git
码农小旋风5 天前
Claude Code 基础用法大全:对话、分析、修改、测试、Git 和工作流
人工智能·git·chatgpt·claude
南大白5 天前
Git 撤回提交完整方案
git
像风一样的男人@5 天前
python --实现代理服务器
git·ui
sbjdhjd5 天前
从零搭建企业级 CI/CD(下):Jenkins+GitLab+Harbor 全链路实战指南
git·servlet·ci/cd·云原生·云计算·gitlab·jenkins
码云数智-大飞5 天前
Go Channel 详解:并发通信的正确姿势
前端·数据库·git