将项目上传到github和码云

tech2022-08-10  137

首先对其中一个进行克隆

git clone https://gitee.com/zixin_lin/weiyi.git

将本地仓库与远程仓库关联起来:

git remote add github https://github.com/872486900/weiyi.git git remote add gitee https://gitee.com/zixin_lin/weiyi.git

pull远程仓库的内容,更新本地仓库,使用–allow-unrelated-histories忽略本地仓库和远程仓库的无关性,强行合并(关键):

git pull github master --allow-unrelated-histories

把本地仓库的内容push到远程仓库:

git push -u github master

git常用命令表

最新回复(0)