Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to reset to a clean working directory in git

Tags:

git

windows-7

I am unable to reset one particular file in my git working directory for some reason beyond my understanding!

Here goes:

I do a git reset --hard now,

 $ git reset --hard
 HEAD is now at 97b3164 Added clojure jars for personal tracking and also set clo
 jure classpath in jaskirat.el

After the hard reset:

 $ git status
 # On branch master
 # Changed but not updated:
 #   (use "git add <file>..." to update what will be committed)
 #   (use "git checkout -- <file>..." to discard changes in working directory)
 #
 #       modified:   elpa-to-submit/color-theme.el
 #
 no changes added to commit (use "git add" and/or "git commit -a")  

I ve also tried git checkout -- elpa-to-submit/color-theme.el But nothing seems to get me back to a "clean" unstaged working directory! :-S

Note: I have a clone of this repo from github on my linux desktop as well, and I don't see any issues like this on my desktop

like image 480
Jaskirat Avatar asked Feb 25 '23 07:02

Jaskirat


1 Answers

From your git diff feedback, it seems to be an EOL issue. Windows uses \r\n, while Linux uses \n. See core.eol, core.safecrlf and core.autocrlf settings in git-config(1).

like image 135
artagnon Avatar answered Feb 28 '23 09:02

artagnon