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

相关推荐
一只大袋鼠11 小时前
Git 进阶(二):分支管理、暂存栈、远程仓库与多人协作
java·开发语言·git
STDD14 小时前
Soulmask《灵魂面具》 专用服务器搭建教程
运维·服务器·github
lolo大魔王15 小时前
Linux的监测程序
linux·运维·github
我叫张小白。18 小时前
Git 分支管理与团队协作
git
米高梅狮子18 小时前
Redis
数据库·redis·mysql·缓存·docker·容器·github
_Evan_Yao19 小时前
如何搭建属于自己的技术博客(CSDN / GitHub Pages)
后端·学习·github
DogDaoDao19 小时前
Windows 下 Git 报错:`touch` 无法识别 —— 原因分析与 7 种解决方案(从入门到精通)
windows·git·程序员·npm·powershell·cmd·touch
Quirkybrain19 小时前
从多态调用到简单析构:C 语言里的对象生命周期管理
github
caicai_xiaobai19 小时前
Ubuntu上Git安装步骤
linux·git·ubuntu
加贝哥|usun20 小时前
最佳实践分享:GitHub项目自动同步到Gitee(码云)
gitee·github