Ignoring extra files in git

Hello everyone. I started to study Rust recently. I have a question, when I compile my program, in addition to the executable file, many other files are created. I'm using cargo new to create a new project. Here is an example of what files the git sees:

How do I tell git ignore the types of these files, I'm a little confused about what to do with them and what they are for. I started a "home" github account and publish my projects there. Sometimes these files are annoying. What are they needed for?

To ignore these files, you should create a .gitignore file and place it in the same folder as where the target/ folder is located. Then add a line to the file containing target to ignore the folder.

1 Like

@alice Thank you very much for your help, everything works :slight_smile: