标签:提交 pos 平台 int 关联 master git 允许 sam
clone
远程仓库到本地开始编码,然后是一系列add
,commit
,push
git remote add
添加远程仓库add
, commit
, push
commit
时就报错了:error: failed to push some refs to ....
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.
这说明此时两个仓库并没有建立关联,两个仓库的代码没有同步。
按照提示使用git pull
拉取远程代码并合并又出现如下错误:
refusing to merge unrelated histories
意思是两个仓库的历史记录不相关。
允许不相关的历史:
git pull origin master --allow-unrelated-histories
然后再push
.
标签:提交 pos 平台 int 关联 master git 允许 sam
原文地址:https://www.cnblogs.com/wotoufahaiduo/p/11669074.html