为一个库设置多个远程更新站用于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了。

相关推荐
CoderJia程序员甲18 小时前
GitHub 热榜项目 - 日榜(2026-03-21)
人工智能·ai·大模型·github·ai教程
irpywp18 小时前
构建生产级 AI Agent工作流
人工智能·github
whale fall1 天前
git add、git commit、git push 的区别和联系
git
倾云鹤1 天前
Git同时推送多个远程仓库
git
sdm0704271 天前
基础开发工具git,gdb
git
胡琦博客1 天前
如何同步远程分支到本地(远程有些分支已经删除了)
git
CoderJia程序员甲2 天前
GitHub 热榜项目 - 日榜(2026-03-20)
人工智能·ai·大模型·github·ai教程
计算机安禾2 天前
【C语言程序设计】第36篇:二进制文件的读写
c语言·开发语言·c++·算法·github·visual studio code·visual studio
用户9751470751362 天前
在 Vite 中配置 CSS 模块
github