本人出现原因:当本地仓库关联远程仓库时,因为本地仓库已经存在文件,同时远程仓库文件已初始化。
执行:
$ git push -u qlll master
$ git push -u qlll master
To https://gitee.com/*****/****.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://gitee.com/smai43_admin/qlll.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
无法建立关联,需要进行版本控制
尝试下拉版本建立联系
$ git pull qlll master
$ git pull qlll master
From https://gitee.com/smai43_admin/qlll
* branch master -> FETCH_HEAD
fatal: refusing to merge unrelated histories
最后:
git pull qlll master --allow-unrelated-histories
$ git pull qlll master --allow-unrelated-histories
From https://gitee.com/*****/****
* branch master -> FETCH_HEAD
Merge made by the 'recursive' strategy.
README.en.md | 36 ++++++++++++++++++++++++++++++++++++
README.md | 39 +++++++++++++++++++++++++++++++++++++++
2 files changed, 75 insertions(+)
create mode 100644 README.en.md
create mode 100644 README.md
pull拉取不下最新的原因是
本地仓库和远程仓库的两个分支是不同的版本,所以拉取不下来,需要解决冲突先
在其代码模块后加上这个参数,强制合并,忽视提交的历史,之后通过代码模块的不同进行合并即可
git pull origin master --allow-unrelated-histories