diff --git a/src/cargo/ops/cargo_new.rs b/src/cargo/ops/cargo_new.rs index 5b4f4faaede..9e08eee13c7 100644 --- a/src/cargo/ops/cargo_new.rs +++ b/src/cargo/ops/cargo_new.rs @@ -384,7 +384,7 @@ fn mk(config: &Config, opts: &MkOptions) -> CargoResult<()> { let path = opts.path; let name = opts.name; let cfg = global_config(config)?; - let ignore = ["target/\n", "**/*.rs.bk\n", + let ignore = ["/target/\n", "**/*.rs.bk\n", if !opts.bin { "Cargo.lock\n" } else { "" }] .concat();