为一个库设置多个远程更新站用于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 小时前
Git 的自我修养
git·svn·gitee
QuZhengRong4 小时前
【Luck‑Report】报表项目运行与部署 - V2 版本
github·agent·报表·可视化·开源项目
robllv19 小时前
别让写代码的同一个 Agent 自己做 Review:我做了个本地跨 Agent 交叉审查工具
github
李永奉10 小时前
Git和GitHub-用操作命令控制Git 分支的查看、创建、切换、合并与删除管理实操教程
git·github
用户693717500138414 小时前
大模型蒸馏到底在蒸什么?一篇文章搞懂知识蒸馏概念
前端·后端·github
徐小夕14 小时前
实测 10 个前端 UI 生成开源 Skill|AI 输出直达上线标准
前端·vue.js·github
得物技术14 小时前
Computer Use与Browser Use:揭秘Agent如何操作电脑和浏览器|得物技术
数据库·github·ai编程
71777715 小时前
SVN 迁移到 Git 用什么工具:git-svn、svn2git 与平台化方案的取舍
git·svn
无奈笑天下1 天前
Linux上kdump故障标准处理流程
linux·运维·服务器·github
李永奉1 天前
Git和GitHub-用操作命令控制Git的工作区、暂存区、本地仓库之间状态的提交教程
git·github