Is there a way to track a new file in git that is excluded by a rule present in .gitignore? I would like to do this without adding a single file/directory exclusion in my .gitignore rules.
Well I was having a tough time finding an answer to this, but to be honest I hadn't tried it yet. Turns out running 'git add' (like below) on a file excluded in .gitignore
git add Test.exe
outputs the following:
The following paths are ignored by one of your .gitignore files:
Test.exe
Use -f if you really want to add them.
fatal: no files added
So revising 'git add' like so will work:
git add -f Test.exe
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With