git-pull错误refusing to merge unrelated histories 发表于 2017-11-06 | 分类于 git | 本文总阅读量 次 在服务器创建好后 应该先拉到本地 再推。 提前推是会报错的。 如果本地已经创建项目 需要合并下。 123456789101112131415161718192021222324252627282930313233343536H:\zcll>git remote add zcll https://git.coding.net/da_/zcll.gitH:\zcll>git push -u zcll masterTo https://git.coding.net/da_/zcll.git ! [rejected] master -> master (non-fast-forward)error: failed to push some refs to 'https://git.coding.net/da_/zcll.git'hint: Updates were rejected because the tip of your current branch is behindhint: 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.H:\zcll>git pull zcll masterFrom https://git.coding.net/da_/zcll * branch master -> FETCH_HEADfatal: refusing to merge unrelated historiesH:\zcll>git pull zcll master --allow-unrelated-historiesFrom https://git.coding.net/da_/zcll * branch master -> FETCH_HEADMerge made by the 'recursive' strategy. README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 README.mdH:\zcll>git push -u zcll masterCounting objects: 148, done.Delta compression using up to 4 threads.Compressing objects: 100% (140/140), done.Writing objects: 100% (148/148), 3.35 MiB | 673.00 KiB/s, done.Total 148 (delta 19), reused 0 (delta 0)remote: Resolving deltas: 100% (19/19), done.To https://git.coding.net/da_/zcll.git 857afd6..252f11c master -> masterBranch master set up to track remote branch master from zcll. 坚持原创技术分享,您的支持将鼓励我继续创作! 赏 微信打赏 支付宝打赏