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

相关推荐
天若有情6731 小时前
【C++原创开源】formort.h:一行头文件,实现比JS模板字符串更爽的链式拼接+响应式变量
开发语言·javascript·c++·git·github·开源项目·模版字符串
海盗12342 小时前
在群晖NAS上使用Git Server
git
y小花2 小时前
git常用指令
git
华科大胡子2 小时前
开源项目 Git 贡献全流程拆解
git
极地星光2 小时前
工程中:Git 子模块(submodule) vs 直接依赖(源码/库/包管理器)
git
果汁华3 小时前
GitHub Trending 热门仓库整理 (2026年4月10日)
github
无限进步_3 小时前
【C++&string】大数相乘算法详解:从字符串加法到乘法实现
java·开发语言·c++·git·算法·github·visual studio
粥里有勺糖4 小时前
视野修炼-技术周刊第129期 | 上一次古法编程是什么时候
前端·javascript·github
无限进步_4 小时前
【C++】验证回文字符串:高效算法详解与优化
java·开发语言·c++·git·算法·github·visual studio
Gavin_ZYX5 小时前
Skill 管理过于繁琐,不如写个自动同步的工具
人工智能·架构·github