美文网首页
项目上传 GitHub 释疑

项目上传 GitHub 释疑

作者: 敲代码的本愿 | 来源:发表于2017-03-03 12:56 被阅读163次

GitHub 新手指南:创建、提交、合并、删除分支等操作
Git 命令:比较全面
超详细教程:文章描述步骤比较详细

问题###

1、fatal: refusing to merge unrelated histories

原因

"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.`
 "git pull" has been taught to pass the "--allow-unrelated-histories" 
option to underlying "git merge".```

**解决**
执行命令`git merge gh-pages --allow-unrelated-histories`,再`push`。

**2、

To https://github.com/huang125/RippleView.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/huang125/RippleView.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.```**

分析
非快进方式的更新被拒绝了,需先从中心仓库pull到最新版本,merge后再push

原因
1、github中的README.md文件不在本地代码目录中

解决
1、查看本地工程目录是否有README.md文件;
2、若没有,执行命令git pull --rebase origin master
3、再查看是否有README.md文件,若有,执行git push -u origin master即可。

相关文章

  • 项目上传 GitHub 释疑

    GitHub 新手指南:创建、提交、合并、删除分支等操作Git 命令:比较全面超详细教程:文章描述步骤比较详细 问...

  • Android 制作远程依赖库

    首先要上传项目到GitHub上,参考Android:上传项目到GitHub[https://www.jianshu...

  • GitHub上传本地项目 之 Github设置SSH keys

    GitHub上传本地项目 之 Github本地项目上传 (2) 一、 准备 (1) 安装 git 在Xcode已经...

  • github上传项目

    1.在github上新建仓库,复制仓库地址 2.使用git工具定位到要上传的项目 3.输入"git init" 初...

  • github上传项目

    1.在命令行中,输入“git init”,使Test文件夹加入git管理;2.输入“git add .”(不要漏了...

  • github上传项目

    参考:https://www.jianshu.com/p/be9f0484af9d 1.注册GitHubGithu...

  • github上传项目

    今天闲来无事搞整一下github上传项目,中间还是有些波折,参考了一下几位网友的综合一下: CKTim——http...

  • GitHub 上传项目

    上传方式有2种: GitHub Desktop上传 终端上传 一、GitHub Desktop上传 下载GitHu...

  • GitHub上传项目

    使用GitHub是每个程序员必备的知识之一。如何使用好GitHub,Google下就有比较好的教程,接下来我所讲的...

  • GitHub上传项目

    主题:向git上传本地项目 step1: 在https://github.com/上注册一个账号 step2: (...

网友评论

      本文标题:项目上传 GitHub 释疑

      本文链接:https://www.haomeiwen.com/subject/rdilgttx.html