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

相关推荐
子兮曰8 小时前
OpenClaw架构揭秘:178k stars的个人AI助手如何用Gateway模式统一控制12+通讯频道
前端·javascript·github
旅之灵夫8 小时前
【GitHub项目推荐--Remotion:使用React编程化创建视频】⭐⭐⭐
github
jiayong2310 小时前
Git 核心概念:Tag 与 Branch 的本质区别
git
Serene_Dream13 小时前
git 合并冲突的分支
git
我是一只puppy14 小时前
使用AI进行代码审查
javascript·人工智能·git·安全·源代码管理
玄同76515 小时前
Git常用命令指南
大数据·git·elasticsearch·gitee·github·团队开发·远程工作
吠品15 小时前
命令行揭示SSL证书真相
https·github·ssl
、BeYourself16 小时前
解决git@github.com: Permission denied (publickey)
github
十步杀一人_千里不留行18 小时前
Git提交前ESLint校验实践(Husky + lint-staged)
git·github
朱昆鹏18 小时前
开源 Claude Code + Codex + 面板 的未来vibecoding平台
前端·后端·github