Skip to content

Commit 4f8934e

Browse files
Add Cargo.lock to version control
Historically the official recommendation was to version control Cargo.lock for applications but gitignore it for libraries. However, it was later recognized that this is a mistake, and there are advantages to always version control Cargo.lock, even for libraries: https://blog.rust-lang.org/2023/08/29/committing-lockfiles/ As a specific example, not having Cargo.lock under version control caused me a minor annoyance when regenerating expected trybuild output (b6a3b08) The file I generated locally didn't match what was happening on GitHub Actions runner, because my Cargo.lock was different.
1 parent 334b006 commit 4f8934e

File tree

2 files changed

+2381
-4
lines changed

2 files changed

+2381
-4
lines changed

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33
target/
44
test-target/
55

6-
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
7-
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
8-
Cargo.lock
9-
106
# These are backup files generated by rustfmt
117
**/*.rs.bk
128

0 commit comments

Comments
 (0)