What files/folder should be committed for version control or zipped for transfer? Using IntelliJ Rust

Okay so this question may sound really silly, but I am using IntelliJ Rust, running on Clion, and I just create my first project/program in Rust. I have multiple computer though, so assuming I want to commit my files on bitbucket, what file/folder structure should I commit, and what should I put into .gitignore.

Anyway, can I have an elegant solution that, say, even if I zip those files/folders and send to another computer which does not have IntelliJ Rust, I can still compile it using rustc, with all the dependency and such in the cargo.toml work. IntelliJ Rust seems to create a bunch of folders, which confused me.

The folder structure is bellow. Thanks in advance.
image

1 Like

You should ignore target, and Cargo.lock if it's a library, which it isn't in your case.

|- src: The directory containing all your source code.
|  |- main.rs: The crate root that contais your main function.
|- target: Contains anything created by rustc, rustdoc etc when building.
|- Cargo.lock: Contains the exact dependency versions used to compile
your project, generated by Cargo automatically.
|- Cargo.toml: The user created manifest that declares package info and
not exact dependency versions.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.