1

I've been having this reoccurring issue recently:

$ git status
On branch foo
Your branch is up to date with 'origin/foo'.

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:   tools/notebook1.ipynb
        modified:   tools/notebook2.ipynb

$ git reset --hard
$ git status
On branch foo
Your branch is up to date with 'origin/foo'.

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:   tools/notebook1.ipynb
        modified:   tools/notebook2.ipynb
$ git stash
$ git status
On branch foo
Your branch is up to date with 'origin/foo'.

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:   tools/notebook1.ipynb
        modified:   tools/notebook2.ipynb

Nothing I do gets rid of the changed files, git diff shows no modification.

How can I a) figure out what non-content changes cause this and b) fix it without git adding and committing them? Fwiw, I am using pre-commit in the repo, but that should not affect anything before commit.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.