Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Cargo.lock into .gitignore #388

Closed
yvvki opened this issue Jul 14, 2023 · 2 comments
Closed

Add Cargo.lock into .gitignore #388

yvvki opened this issue Jul 14, 2023 · 2 comments

Comments

@yvvki
Copy link

yvvki commented Jul 14, 2023

From this documentation https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html, it's stated that

If you’re building a non-end product, such as a rust library that other rust packages will depend on, put Cargo.lock in your .gitignore.

The GitHub gitignore convention uses it: https://github.com/github/gitignore/blob/main/Rust.gitignore

...
# 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
Cargo.lock
...
@phil-opp
Copy link
Member

Thanks for raising this issue! I'm aware of the official recommendations, but I'm still in favor of keeping the Cargo.lock checked in for two reasons:

  1. There are plans to change the official recommendations to always check in the Cargo.lock. See:
  1. This project consists of multiple crates that are combined together. Most of them are built as binaries. So even with the current recommendation, we should keep the Cargo.lock checked in.

@yvvki
Copy link
Author

yvvki commented Jul 14, 2023

All right, I'll hold off the pull request. Thanks for the review!

@yvvki yvvki closed this as completed Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants