Git报错的解决方案汇总
错误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.
解决方案:
错误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报错的解决方案汇总的更多相关文章
- 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远程仓库提交本地项目文件时 ...
- 关于Entity Framework中的Attached报错相关解决方案的总结
关于Entity Framework中的Attached报错的问题,我这里分为以下几种类型,每种类型我都给出相应的解决方案,希望能给大家带来一些的帮助,当然作为读者的您如果觉得有不同的意见或更好的方法 ...
- 新手常见的python报错及解决方案
此篇文章整理新手编写代码常见的一些错误,有些错误是粗心的错误,但对于新手而已,会折腾很长时间才搞定,所以在此总结下我遇到的一些问题.希望帮助到刚入门的朋友们.后续会不断补充. 目录 1.NameErr ...
- Mysql only_full_group_by以及其他关于sql_mode原因报错详细解决方案
Mysql only_full_group_by以及其他关于sql_mode原因报错详细解决方案 网上太多相关资料,但是抄袭严重,有的讲的也是之言片语的,根本不连贯(可能知道的人确实不想多说) 我总共 ...
- git报错:'fatal:remote origin already exists
git报错:'fatal:remote origin already exists'怎么处理?附上git常用操作以及说明. git添加远程库的时候有可能出现如下的错误, 怎么解决? 只要两步: 1 ...
- 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 -- ...
- 记Git报错-refusing to merge unrelated histories
记Git报错-refusing to merge unrelated histories 系统:win7 git版本: 2.16.2.windows.1 问题 1.本地初始化了git仓库,放了一些 ...
- 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 ...
- 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 ...
随机推荐
- <NET CLR via c# 第4版>笔记 第6章 类型和成员基础
6.1 类型的各种成员 6.2 类型的可见性 public 全部可见 internal 程序集内可见(如忽略,默认为internal) 可通过设定友元程序集,允许其它程序集访问该程序集中的所有inte ...
- java的代理(编程思想)
代理 第三种关系被称为代理,java并没有提供对它的直接支持.这是继承和组合之间的中庸之道,因为我们将一个对象置于所要构造的类中(就像组合),但与此同时我们在新类中暴露了该成员对象的所有方法(就像继承 ...
- Microsoft Office 2010 Service Pack 2 发布更新
Microsoft Office 2010 32 位版本 的 Service Pack 2 (SP2) 包含的新更新可以提高安全性.性能和稳定性.此外,SP 是以前发布的所有更新的汇总. 下载更新补丁 ...
- 开始yaf之旅
目录结构 + public //网站根目录 - index.php //入口文件 - .htaccess //重写规则 + conf |- application.ini //配置文件 applica ...
- 第三方插件Vue-Lazyload
使图片懒加载
- Map排序(按key排序,按value排序)
主要分两种,按键排序.按值排序. 而且,按key排序主要用于TreeMap,而按value排序则对于Map的子类们都适用. 一.按键排序 按Key排序主要用于TreeMap,可以实现按照Key值的大小 ...
- 深入__proto__和prototype的区别和联系
前话 有一个一个装逼的同事,写了一段代码 function a(){} a.__proto__.__proto__.__proto__ 然后问我,下面这个玩意a.__proto__.__proto__ ...
- 重新理理C++:从《c++ primer》开始
以前学过C++,但是感觉很多东西还是不清不楚,很多问题解决起来啃吧啃吧的.... 即使c++的东西看过,但是这本书看起来速度还是提不上去,确实需要扎实扎实.很多以前只会用的东西,这本书上都讲的很清楚, ...
- Git 学习记录一
主要来源参考http://www.runoob.com/git/git-install-setup.html Windows 平台上安装 在 Windows 平台上安装 Git 同样轻松,有个叫做 m ...
- 使用nomad && consul && fabio 创建简单的微服务系统
具体每个组件的功能就不详细说明了 nomad 一个调度工具,consul 一个服务发现,健康检查多数据中心支持的工具 fabio 一个基于consul的负载均衡&&动态路由工具,对于集 ...