为一个库设置多个远程更新站用于git push,比如gitcode github等

复制代码

为当前的gitcode库添加github push功能

当前的库对应的是gitcode,远程名字设置为origin

复制代码
git remote add origin https://gitcode.com/skywalk163/liulanqifanyichajian

现在想让它也能更新推送到github,因此再加上一条远程,起个名字叫github:

复制代码
git remote add github https://github.com/skywalk163/liulanqifanyichajian
git push --set-upstream github main

github库里LICENSE 这个文件怎么删除?

push的报错:

git push github main

To https://github.com/skywalk163/jikuaiexplorer

! [rejected] main -> main (fetch first)

error: failed to push some refs to 'https://github.com/skywalk163/jikuaiexplorer'

hint: Updates were rejected because the remote contains work that you do not

hint: have locally. This is usually caused by another repository pushing to

hint: the same ref. If you want to integrate the remote changes, use

hint: 'git pull' before pushing again.

hint: See the 'Note about fast-forwards' in 'git push --help' for details.

这个库里只有一个文件,就是LICENSE 文件。在网站没有找到删除LICENSE文件的地方....

我不想git pull 再删除。

所以最后选了把repo项目删除再重建repo的操作,重建的时候没有再选择license,这样新创建的就是一个完全空白的repo。

然后git push就pass了。

相关推荐
一点一木2 小时前
🚀 2026 年 4 月 GitHub 十大热门项目排行榜 🔥
人工智能·github
Qres8214 小时前
Git安装记录
git
宝桥南山5 小时前
AI - 在命令行中尝试一下ACP(Agent Client Protocol)通信
microsoft·微软·github·aigc·copilot
wj3055853785 小时前
Codex + Git 开发环境配置指南(WSL版)
linux·运维·git
拾贰_C7 小时前
【Github | GitHub Copilot | 学生认证】 GitHub Copilot学生如何认证
github
楠枬8 小时前
Git 分支管理
git
旅之灵夫8 小时前
【GitHub项目推荐--OpenArm:开源7自由度仿人机械臂平台】
github
一乐小哥9 小时前
坚持迭代一个 Chrome 插件半年后,我的同事问我:"这不是 Chrome 自带的功能吗?"
chrome·github·ai编程
Smilezyl9 小时前
一个独立开发者,靠一份 markdown 驱动 Claude Code, 用 20 天跑通 9 个包的 monorepo 工程
前端·人工智能·github
峰向AI9 小时前
做小红书、画信息图、动漫图:这个skill太实用了
github