I have a .gitignore
file for an open source project that contains the following line:
*~
What does this line - an asterisk followed by a tilde - mean in the context of a .gitignore
file?
I have tried Googling but to no avail.
See https://git-scm.com/docs/gitignore section "Pattern Format", in this case:
If the pattern does not contain a slash /, Git treats it as a shell glob pattern and checks for a match against the pathname relative to the location of the .gitignore file (relative to the toplevel of the work tree if not from a .gitignore file).
So it would ignore all files whos name ends with a tilde.
It means nothing in particular to Git. It'll simply make Git close its eyes over any file which name ends with a tilde
Files with names ending with a tilde may be created by some software the original programmer has used, such as text editors, say temporary files, backup files or swap files for instance. You don't want those to show in your repository, as they are irrelevant to the actual source code.
A *~
line is just the same as a .*.swp
line added by a Vim user for instance.
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