2

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.

1 Answer 1

1

I found some configuration in .git/config that looked like this

[filter "nbstripout"]
    clean = \"venv/python3\" -m nbstripout
    smudge = cat
[diff "ipynb"]
    textconv = \"venv/python3\" -m nbstripout -t

Removing them solved this issue for now.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .