您好,欢迎来到刀刀网。
搜索
您的当前位置:首页Git报错的解决方案汇总

Git报错的解决方案汇总

来源:刀刀网
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 ...\" to update what will be committed)

# (use \"git checkout -- ...\" to discard changes in working directory)no changes added to commit (use \"git add\" and/or \"git commit -a\")解决⽅案:

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

错误3:

error: failed to push some refs to

hint: Updates were rejected because the tip of your current branch is behindhint: 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. 错误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. 错误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 mastergit 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 dohint: not have locally. This is usually caused by another repository pushinghint: to the same ref. You may want to first integrate the remote changeshint: (e.g., 'git pull ...') before pushing again.

hint: See the 'Note about fast-forwards' in 'git push --help' for details.

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

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- gamedaodao.com 版权所有 湘ICP备2022005869号-6

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务