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

相关推荐
触底反弹3 小时前
Vibe Coding 不写 Git,等于悬崖边飙车
人工智能·git·面试
泡沫冰@4 小时前
基于Git、Jenkins、Podman、ECS的CI/CD实践
git·jenkins·podman
zfoo-framework5 小时前
git拦截大于5M文件
git
码流怪侠7 小时前
【GitHub】WorldMonitor:一个工程极致主义的实时全球情报仪表盘深度解析
github
马里马里奥-8 小时前
VS Code Git 工作树:解锁多分支并行开发新体验
git
北极糊的狐11 小时前
20.3 使用 Vercel CLI 手动部署(无需 GitHub,适合不常更新的项目)
github
2401_8534482312 小时前
Git安装流程和基础使用步骤
git·github
官乐12 小时前
Github创建上传仓库流程
github
tokenKe13 小时前
Buzz:蜂巢意识协作平台|Agent 不是 Bot,而是持有独立密钥对的团队成员|SSP Github Daily
github
zdkdchao15 小时前
建立gitee对github仓库的镜像
gitee·github