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 ...
随机推荐
- Spinner的用法
1.先自定义一个数组 2.在new一个ArrayAdapter方法: ArrayAdapter<String> adapter = new ArrayAdapter<String&g ...
- web程序2
.
- nginx-vod-module && docker && docker-compose 测试
nginx-vod-module appdemo i reference [nginx-vod-module-docker](https://github.com/NYTimes/nginx-vod- ...
- 初识安卓小程序(Android短信发送器)
首先,先创建一个安卓项目(我的版本号是4.4.2的),名字为"短信发送器" 然后在res目录下找到layout目录,找到activity_main.xml或fragment_mai ...
- DB2经常使用命令
1.打开命令行窗体 #db2cmd 2.打开控制中心 # db2cmd db2cc 3.打开命令编辑器 db2cmd db2ce =====操作数据库命令===== 4.启动数据库实例 #db2s ...
- Spring Could与Dubbo、Docker、K8S
如果你是在一个中小型项目中应用Spring Cloud,那么你不需要太多的改造和适配,就可以实现微服务的基本功能.但是如果是在大型项目中实践微服务,可能会发现需要处理的问题还是比较多,尤其是项目中老代 ...
- 【转】Linux shell的&&和||
原文网址:http://www.2cto.com/os/201302/189655.html Linux shell的&&和|| shell 在执行某个命令的时候,会返回一个返回值 ...
- mysql 源代码目录及安装目录介绍
1.源代码目录介绍: 1.BUILD BUILD目录是编译.安装脚本目录,绝大部分以compile-开头,其中的SETUP.sh脚本为C和C++编译器设置了优化选项.2.client cl ...
- bzoj 4036 [HAOI2015]按位或——min-max容斥+FMT
题目:https://www.lydsy.com/JudgeOnline/problem.php?id=4036 题解:https://www.cnblogs.com/Zinn/p/10260126. ...
- C#多线程编程之:异步事件调用
当一个事件被触发时,订阅该事件的方法将在触发该事件的线程中执行.也就是说,订阅该事件的方法在触发事件的线程中同步执行.由此,存在一个问 题:如果订阅事件的方法执行时间很长,触发事件的线程被阻塞,长时间 ...