The solution is to place a leading slash on the .gitignore entries:
/foo/
/bar.txt
(I thought I tried this before posting on StackOverflow, but clearly I hadn’t tried it properly, as this works perfectly.)
The solution is to place a leading slash on the .gitignore entries:
/foo/
/bar.txt
(I thought I tried this before posting on StackOverflow, but clearly I hadn’t tried it properly, as this works perfectly.)