Git - how to disable a file

In short, I accidentally added a file to .gitignore, which I committed and clicked.

Now I deleted the file from .gitignore, but it still does not appear.

What else do I need to do?

+4
source share
2 answers

I'm stupid, he stayed in the global gitignore, so he didn’t show up.

+4
source

You might want to restore this file from the repository and confirm it again:

git checkout 35fbd83 -- path/to/your/file

35fbd83 is a SHA commit where this ignored file is still present.

git add path/to/your/file
git commit -m 'missing file is back'

.gitignore . , , git . , git reset --hard git checkout, , .

0

All Articles