git - git pull: fatal: refusing to merge unrelated histories
问题描述
Description: I have a remote repository with his data. I have a local repository with his data.
I want to clone/pull the data from my remote repo to my local repo without changing the local repo folder structure.
Or I want to push my local repo to my remote repo with the local repo structure without altering the remote repo folder structure. I want to keep my local repo for future pushing.
- git init [ok] Output: Initialized empty Git repository in [...]
- git add . [ok]
- git commit -m "first commit" [ok] Output: 9 files changed, 168 insertions(+) [...]
- git remote add origin https://github.com/Mi7ai/Spring.git [ok]
- git remote -v [ok] Output: origin https://github.com/Mi7ai/Spring.git (fetch) origin https://github.com/Mi7ai/Spring.git (push)
- git push origin master [warning] Output: hint: Updates were rejected because the remote contains work that you do [...]. You may want to first integrate the remote changes hint: (e.g., 'git pull ...') before pushing again.
- git pull origin master [warning] Output: * branch master -> FETCH_HEAD fatal: refusing to merge unrelated histories
I have read that --allow unrelated histories is not the right way to do it.
How should I achieve what I want?
OS: Windows 10
Thanks.
解决方案
推荐阅读
- loops - Ansible 2.7.5 | 错误!'set_fact' 不是 Play 的有效属性
- c# - Unity:场景更改后更改滑块值保存
- angular - 问题打字稿执行顺序失败
- apache-flink - 使用双键删除状态时遇到问题
- d3.js - d3js 无法附加到 clipPath
- javascript - 创建的节点没有 attachEvent 属性
- python - JSON 中的决策树 - 将叶子返回给给定叶子的根路径
- node.js - 使用 Mocha 和 chai 库测试 nodejs 方法
- stripe-payments - Stripe Connect 是否允许为客户(买家)账户充值?
- c# - 从 localfile 写入文件流时出现 IOException