Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git错误总结 #16

Open
253867843 opened this issue Aug 7, 2019 · 0 comments
Open

git错误总结 #16

253867843 opened this issue Aug 7, 2019 · 0 comments
Assignees
Labels

Comments

@253867843
Copy link
Owner

https://www.jianshu.com/p/1a5b25c86415

错误1:

Administrator MINGW32 /d/blog (dev)
$ git checkout master
error: Your local changes to the following files would be overwritten by checkout:
        .idea/workspace.xml
Please commit your changes or stash them before you switch branches.
Aborting

错误的原因是:直接在远程仓库包操作了,修改了github上面的东西,相当于服务器上面的东西,而本地没有修改,当想改变分支的时候,出现了改变分支的时候会重写文件,所以必须把修改的提交到版本库里面。或者是隐藏在你切换分支之前。

解决方法:

抛弃本地的修改,回到上一个版本
git reset --hard
然后,切换你的分支
git checkout master 
@253867843 253867843 added the git label Aug 7, 2019
@253867843 253867843 self-assigned this Aug 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant