first line of .gitignore, created by cargo new, should be
target/
instead of
/target
Hm, I think this is the intended behavior: with /target, we'll ignore the target dir only at the root of the project. With target/, any target dir anywhere will be ignored, so, for example, you won't be able to have src/target/mod.rs.
Technically it should be /target/, but either works.
I'm going to close this as intended behavior.
Most helpful comment
Technically it should be
/target/, but either works.