7

git reset --hard not work

 3 years ago
source link: http://blog.devwiki.net/index.php/2020/03/17/git-reset-hard-not-work.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

DevWiki

git reset --hard not work
在使用 git 切换分支时, 提示我本地有更改, 准备reset 然后切换分支:git reset --hard ...
扫描右侧二维码阅读全文
17
2020/03

git reset --hard not work

  1. 首页

在使用 git 切换分支时, 提示我本地有更改, 准备reset 然后切换分支:

git reset --hard
git status

但是并未得到想要的结果:

image-20200317114244356
image-20200317114244356

仍旧提示有文件被修改, 这就很奇怪了. reset --hard 本来就是不保留文件修改的恢复.

Google 搜索了一下: Unstaged changes left after git reset --hard - Stack Overflow

说是和 .gitattributes文件有关, 于是按照说明, 先删除再 reset:

image-20200317114642802
image-20200317114642802

在此 作为记录.

最后修改:2020 年 03 月 17 日 11 : 50 AM
如果觉得我的文章对你有用,请随意赞赏

发表评论 取消回复

评论 *

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK