我码云上有个git仓库
如果我在本地又 git init 初始化了一个仓库,
那么这个新的仓库能 push 到码云上的仓库,和码云上的仓库合并吗?
我试了一下,提示出错,我不知道是我操作的问题还是不可以这样做!
$ git push -u origin master
To gitee.com:***
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'gitee.com:***'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
1.把本地仓库的远端地址设置成你码云仓库的地址
2.然后运行git pull获取
3.再commit 和 push
(不过为啥不把你码云的仓库克隆到本地然后在里面修改呢)