I am working on a project with a shell script file (let's say a.sh
) in it.
I clone the repo on Windows and accidentally run a.sh
. Then, when I run git status
in git bash, I got the following information
git status
on branch master
Changes not staged for commit:
(use "git add <file> ..." to update what will be committed)
(use "git restore <file> ..." to discard changes in working directory)
modified: a.sh
Obviously, I do not want this a.sh
to be changed, and I follow the hint with
git restore a.sh
However, when I run git status
again, I still got the same information that a.sh
was modified.
I also tried another way by stage and commit this file with git commit -am "restore sh"
, then try to reset this file by git restore head^ a.sh
. The result is still the same.
So I was wondering if there are any methods to tackle this problem?
FYI, according to my colleagues, a.sh
is used for killing idle python thread. When I git diff
this file, it shows that
old mode 100755
new mode 100644
I am not so familiar with shell script, so I am not sure if this information will be helpful.