I want to tell git to ignore e.g. jpg files regardless of how the extension is written.
e.g.
*.jpg
should ignore
.jpg, .JPG., .Jpg
etc.
Is that possible without telling git to ignore case altogether?
If you want to ignore a file that you've committed in the past, you'll need to delete the file from your repository and then add a . gitignore rule for it. Using the --cached option with git rm means that the file will be deleted from your repository, but will remain in your working directory as an ignored file.
Just a note: gitignore is case-sensitive.
Excluding local files without creating a .Use your favorite text editor to open the file called . git/info/exclude within the root of your Git repository. Any rule you add here will not be checked in, and will only ignore files for your local repository.
To ignore untracked files, you have a file in your git folder called . git/info/exclude . This file is your own gitignore inside your local git folder, which means is not going to be committed or shared with anyone else. You can basically edit this file and stop tracking any (untracked) file.
Git ignore understands glob pattern, so you can use this
*.[jJ][pP][gG]
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