From 99c3da48744b5ddcb9292fbee32659dec5d9dba3 Mon Sep 17 00:00:00 2001 From: Joel Ellis Date: Thu, 16 Jul 2020 18:35:56 +0000 Subject: [PATCH] Improve the guidance on Cargo.lock in Rust.gitignore See the following for more information: - https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html - https://doc.rust-lang.org/cargo/faq.html#why-do-binaries-have-cargolock-in-version-control-but-not-libraries --- Rust.gitignore | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Rust.gitignore b/Rust.gitignore index ff47c2d77d..3ca1767367 100644 --- a/Rust.gitignore +++ b/Rust.gitignore @@ -3,8 +3,10 @@ debug/ target/ -# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries -# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html +# If this is a library or crate (that other Rust projects will depend upon), keep Cargo.lock in your .gitignore. +# If you’re building a binary or system library with crate-type of staticlib or cdylib, remove Cargo.lock from your .gitignore. +# If you're curious about why that is, see "Why do binaries have Cargo.lock in version control, but not libraries?" in the FAQ. +# https://doc.rust-lang.org/cargo/faq.html#why-do-binaries-have-cargolock-in-version-control-but-not-libraries Cargo.lock # These are backup files generated by rustfmt