In git-status, I have
sandbox.sh
sandbox.sh~
I would like to ignore the latter file.
How can you ignore files with extension of some snake ~?
Just add *~
to your .gitignore
.
This will ignore all the files ending with ~
The pattern to ignore anything ending with ~
is *~
. These files are probably left as backup by your text editor, hence are specific to you, and not to the project. The best is to add this *~
to your user-wide ignore file, i.e. ~/.config/git/ignore
(create it if it does not exist) on recent enough versions of Git.
Alternatively, you can add it to your project's .gitignore
file, but
1) It will add noise to the project's history. If N developers each use a different text editor with different conventions, you'll end-up with N lines in your .gitignore
file.
2) You would have to do it for each project you contribute to.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With