错误1:

error: Your local changes to the following files would be overwritten by merge:
Please, commit your changes or stash them before you can merge.

解决方案:

https://stackoverflow.com/questions/15745045/how-do-i-resolve-git-saying-commit-your-changes-or-stash-them-before-you-can-me

错误2:

# On branch master
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
no changes added to commit (use "git add" and/or "git commit -a")

解决方案:

https://stackoverflow.com/questions/7704480/why-does-git-commit-not-save-my-changes

先执行git add 操作,然后才能执行git commit操作

错误3: 
error: failed to push some refs to
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

解决方案:https://stackoverflow.com/questions/10298291/cannot-push-to-github-keeps-saying-need-merge

错误4:

Local changes were not restored
Before update your uncommitted changes were saved to stash.
Update is not complete, you have unresolved merges in your working tree
Resolve conflicts, complete update and restore changes manually.

解决方案:https://www.jianshu.com/p/bc06970cb605

错误5:

error: The following untracked working tree files would be overwritten by merge:
        .idea/junitgenerator-prj-settings.xml
Please move or remove them before you can merge.
Aborting

解决方案:

将提示中的文件,如上提示的是.idea/junitgenerator-prj-settings.xml,将这个文件删除。

然后再执行下面的操作:

git pull origin master
git add .
git commit -m "本次提交的名称"
git push origin master

错误6:

$ git push origin master

error: failed to push some refs to 'https://github.com/.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

解决方法:想将本地仓库代码提交到远程仓库,必须获取和合并最新的远程仓库代码。先执行git pull操作,保持代码版本一致,然后再git push。

Git报错的解决方案汇总的更多相关文章

  1. Updates were rejected because the remote contains work that you do(git报错解决方案)

    Updates were rejected because the remote contains work that you do(git报错解决方案) 今天向GitHub远程仓库提交本地项目文件时 ...

  2. 关于Entity Framework中的Attached报错相关解决方案的总结

    关于Entity Framework中的Attached报错的问题,我这里分为以下几种类型,每种类型我都给出相应的解决方案,希望能给大家带来一些的帮助,当然作为读者的您如果觉得有不同的意见或更好的方法 ...

  3. 新手常见的python报错及解决方案

    此篇文章整理新手编写代码常见的一些错误,有些错误是粗心的错误,但对于新手而已,会折腾很长时间才搞定,所以在此总结下我遇到的一些问题.希望帮助到刚入门的朋友们.后续会不断补充. 目录 1.NameErr ...

  4. Mysql only_full_group_by以及其他关于sql_mode原因报错详细解决方案

    Mysql only_full_group_by以及其他关于sql_mode原因报错详细解决方案 网上太多相关资料,但是抄袭严重,有的讲的也是之言片语的,根本不连贯(可能知道的人确实不想多说) 我总共 ...

  5. git报错:'fatal:remote origin already exists

    git报错:'fatal:remote origin already exists'怎么处理?附上git常用操作以及说明.   git添加远程库的时候有可能出现如下的错误, 怎么解决? 只要两步: 1 ...

  6. Git报错 bad numeric config value '100000' for 'pack.windowmemory': out of range

    Git报错 bad numeric config value '10240M' for 'pack.windowmemory': out of range $ git config --edit -- ...

  7. 记Git报错-refusing to merge unrelated histories

    记Git报错-refusing to merge unrelated histories   系统:win7 git版本: 2.16.2.windows.1 问题 1.本地初始化了git仓库,放了一些 ...

  8. linux git 报错提示 fatal: 'origin' does not appear to be a git repository 解决办法

    输入: git pull origin master git报错提示 fatal: 'origin' does not appear to be a git repository fatal: Cou ...

  9. Git fetch和git pull的区别, 解决Git报错:error: You have not concluded your merge (MERGE_HEAD exists).

    Git fetch和git pull的区别, 解决Git报错:error: You have not concluded your merge (MERGE_HEAD exists). Git fet ...

随机推荐

  1. 古董留念 - Microsoft Office 4.2中文版

    Office 4.2是Office 95的前一个版本,最适合运行在Windows 3.x上,但即使是最新的Windows 7 32位版也是可以安装它的(不信你可以试试)! 原版以软盘为载体,安装一次需 ...

  2. 错误 1 类,结构或接口成员声明中的标记"="无效

    using System;using System.Collections.Generic;using System.Linq;using System.Text; namespace Console ...

  3. (转)亿级Web系统搭建——单机到分布式集群

    当一个Web系统从日访问量10万逐步增长到1000万,甚至超过1亿的过程中,Web系统承受的压力会越来越大,在这个过程中,我们会遇到很多的问题.为了解决这些性能压力带来问题,我们需要在Web系统架构层 ...

  4. SVN的 安装

    关于svn的安装,如图分别是服务端和客户端 下载地址:http://subversion.apache.org/packages.html 1.双击VisualSVN,点下一步,选择目录,就可以,很简 ...

  5. opencv之批量转换灰度图并保存

    当图片名字有数字规律时,批量处理方式. ①srcImage 图片名字有规律 ②将srcImage文件下的图片,转换为灰度图并保存入grayImage文件夹. ③ #include <iostre ...

  6. (简单)冒泡和直接选择排序同时调用swap算法

    void swap(int &a , int &b) { int temp; temp = a; a=b; b=temp; } void bubble(int a[],int n) { ...

  7. 获取 graphql schema 信息

    模块 npm install -g get-graphql-schema get-graphql-schema GRAPHQL_URL > schema.graphql 简单使用 使用prism ...

  8. graphql 文档 docker 镜像

    因为一些原因 graphql 的官方文档无法查看,后者查看不能是方便,所以在官方github 的文档基础上添加了容器构建, 方便进行查看,对于公司内部使用学习会比较好 原理 很简单,openresty ...

  9. 使用ndk-stack来查找崩溃

    logcat报错 Fatal signal 6 (SIGABRT) at 0x000025c9 (code=-6), thread 9703 (Thread-1277) 都是一些寄存器以及函数地址,真 ...

  10. 解决Mybatis没有代码提示

    MyBatis xml文件中代码自动提示 工具/原料   eclipse,maven 方法/步骤   1 一.获得mybatis-3-config.dtd.mybatis-3-mapper.dtd 这 ...