Reason:

The reason is because I created repo in Github with initiated README.md file, and I tried to push a whole different project in to it.

"git merge" used to allow merging two branches that have no common base by default, which led to a brand new history of an existing project created and then get pulled by an unsuspecting maintainer, which allowed an unnecessary parallel history merged into the existing project. The command has been taught not to allow this by default, with an escape hatch --allow-unrelated-histories option to be used in a rare event that merges histories of two projects that started their lives independently.

Solution:


add options behind

git push origin master --allow-unrelated-histories

git使用笔记(四)错误报告 Git push rejected error: fatal: refusing to merge unrelated histories的更多相关文章

  1. git 出现 fatal: refusing to merge unrelated histories 错误

    git pull 失败 ,提示:fatal: refusing to merge unrelated histories 其实这个问题是因为 两个 根本不相干的 git 库, 一个是本地库, 一个是远 ...

  2. 解决Git中fatal: refusing to merge unrelated histories

    原文链接: https://blog.csdn.net/wd2014610/article/details/80854807 Git的报错 在使用Git的过程中有时会出现一些问题,那么在解决了每个问题 ...

  3. Git 如何解决部署远程仓库出现 fatal: refusing to merge unrelated histories 问题

    想把本地仓库的文件搬到Github,先将远程仓库和本地仓库关联起来: 先到Github上复制远程仓库的SSH地址: 运行 git remote add origin 你复制的地址 理论上—如果在创建 ...

  4. git pull fatal: refusing to merge unrelated histories

    1.首先我github有个远程仓库,然后我本地有个仓库 本地仓库我新添加了一个文件,然后我去关联(git remote add origin git@github.com:qshilary/gitte ...

  5. 成功解决Git:fatal: refusing to merge unrelated histories

    Get 报错 如果合并了两个不同的开始提交的仓库,在新的 git 会发现这两个仓库可能不是同一个,为了防止开发者上传错误,于是就给下面的提示 fatal: refusing to merge unre ...

  6. Git:fatal: refusing to merge unrelated histories

    如何去解决fatal: refusing to merge unrelated histories 先pull,因为两个仓库不同,发现refusing to merge unrelated histo ...

  7. GIt -- fatal: refusing to merge unrelated histories 问题处理

    今晚碰到这个问题-- fatal: refusing to merge unrelated histories 想了一下,为什么就这样了? 因为我是先本地创建了仓库,并添加了文件,然后再到github ...

  8. git pull 拉取报错:fatal: refusing to merge unrelated histories

    fatal: refusing to merge unrelated histories(拒绝合并不相关的历史) 使用 git pull origin master --allow-unrelated ...

  9. git pull 失败 ,提示:fatal: refusing to merge unrelated histories

    首次 git pull 时失败,并提示:fatal: refusing to merge unrelated histories 在使用git pull 命令时,添加一个可选项 git pull or ...

随机推荐

  1. IDEA连接linux服务器

    idea连接linux(完成了xshell和xftp连接linux的功能,可以直接卸载这俩了..) File->settings->Deployment左侧加号添加 选择传输类型ftp或者 ...

  2. Codeforces Gym 100431A Achromatic Number 欧拉回路

    原题链接:http://codeforces.com/gym/100431/attachments/download/2421/20092010-winter-petrozavodsk-camp-an ...

  3. Android 沉浸式全屏

    Android 4.4 带来了沉浸式全屏体验, 在沉浸式全屏模式下, 状态栏. 虚拟按键动态隐藏, 应用可 以使用完整的屏幕空间, 按照 Google 的说法, 给用户一种 “身临其境” 的体验. A ...

  4. xamarin studio 安装

    公司wpf项目移植到mac,用到mono来进行重写,不会,自己开搞 首先一个问题Xamarin怎么读,xaml熟悉吧,xaml读作Zamel,xamarin也就读作Zamerin,恩,就是它了... ...

  5. C#中通过反射获取类中非公有成员

    public class NGlbGlobeXComm { public static T GetPrivateField<T>(object instance, string field ...

  6. 【西祠日志】【07】努力努力,找资料,思考,怎么做asp图片上传

    [西祠日志][07]努力努力,找资料.思考.怎么做asp图片上传  (2015.07.23周四) 今天忘了带本子.直接写在书上了笔记,晚点还是夹在本子里. 学了这么久的web应用,一直都没时间去做一点 ...

  7. 多选checkbox

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  8. 【bzoi2006】【狼抓兔子】【最小割】

    Description Source: Beijing2006 [BJOI2006] 八中OJ上本题链接:http://www.lydsy.com/JudgeOnline/problem.php?id ...

  9. mysql 执行sql文件的方法

     http://philos.iteye.com/blog/162051   实战代码: #mysql导入mysql -um4n -p01D060A476642BA8335B832AC5B211F22 ...

  10. Perl图书的一些体会

    近期,由于项目须要.又又一次将Perl学习起来. Perl老实说.让我又爱又恨. 爱它.是由于自己写代码的确非常爽. 是代码最少.速度最快的语言. 恨是由于看别人的代码实在太累了. 但,整体体会,在文 ...