You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Discard changes not working properly, still appears in git status #28326
Here is the screencast. The file in mention is index.html.
I added a comment line, <!-- Changes here --> , in the file; saved it, and there it appears in the Changes which is perfectly fine.
Then I did a Discard Changes on this file, the changes were "removed" from the file shown. But when running git status -zu; git status, the file index.html is still here.
And restarting Code doesn't help.
Sorry about the choppy quality. Was just testing this app out. If you want, I can try it again with another recording software which I think produces better quality.
Code seems to be doing the right thing here... just the command line git seems to be doing the wrong thing... So... if you go to disk, what are the real contents of that file, if you open it in Nodepad?
Activity
joaomoreno commentedon Jun 14, 2017
If you close Code and open it again those changes still don't appear?
iamdevlinph commentedon Jun 14, 2017
João Moreno (@joaomoreno) Just checked. Still doesn't appear on Code restart.
joaomoreno commentedon Jun 14, 2017
Does it happen only with that specific
filter.component.jsfile? Or other files won't show up either?iamdevlinph commentedon Jun 14, 2017
It happens to any file. It's the
Discard Changesfunctionality itself that is somehow acting up.joaomoreno commentedon Jun 14, 2017
That sounds very odd. What does
git status -zureturn? Can you provide a movie screencast reproducing the issue?iamdevlinph commentedon Jun 14, 2017
The file which I did
Discard Changesappears in the result ofgit status -zu.I will provide one ASAP.
iamdevlinph commentedon Jun 14, 2017
Here is the screencast. The file in mention is
index.html.I added a comment line,
<!-- Changes here -->, in the file; saved it, and there it appears in theChangeswhich is perfectly fine.Then I did a
Discard Changeson this file, the changes were "removed" from the file shown. But when runninggit status -zu; git status, the fileindex.htmlis still here.And restarting Code doesn't help.
View my screencast here
Sorry about the choppy quality. Was just testing this app out. If you want, I can try it again with another recording software which I think produces better quality.
joaomoreno commentedon Jun 15, 2017
Code seems to be doing the right thing here... just the command line git seems to be doing the wrong thing... So... if you go to disk, what are the real contents of that file, if you open it in Nodepad?
iamdevlinph commentedon Jun 15, 2017
Hmm. Weird. The change is not there when I opened the file in Notepad.
It's really the CLI git acting up.
Discard changein Code is equivalent togit checkout -- file/to/path?joaomoreno commentedon Jun 15, 2017
You can see exactly what Code calls git with by running
Git: Show Git Output.Closing since the issue isn't related to Code.
Maybe it's related to the
fscachesetting: https://superuser.com/questions/974078/what-does-the-filesystem-cache-do-in-windows-7iamdevlinph commentedon Jun 15, 2017
Turning
fscacheon or off doesn't help. Running Code as admin doesn't help either.I found that
Discard changein Code runsgit checkout -q -- file/to/path.I copied this command and put in the cli and it works properly.
iamdevlinph commentedon Jun 15, 2017
I think the problem is with
Ubuntu on Windows.Running
git statusinGit bashdoesn't show any file.joaomoreno commentedon Jun 15, 2017
#13138
iamdevlinph commentedon Jun 16, 2017
Issue was with the file configuration in git.
Need to have the following set as:
Read more here