I often have extra files that I want to gitignore but I don't want to push the .gitignore with my ignores in it since it pollutes the team's code repo as those ignore are technically just for.
Is there a way to have a local ignore just for me?
I often have extra files that I want to gitignore but I don't want to push the .gitignore with my ignores in it since it pollutes the team's code repo as those ignore are technically just for.
Is there a way to have a local ignore just for me?
Yes, there are two options for this. This is a great option for files that are specific to your situation, such as editor-specific files, that you want to ignore but aren't universally applicable
If the files you want to ignore are specific to your project, you can use .git/info/exclude
. That's specific to your repo.
If the files you want to ignore are general across all repos, you can use core.excludesFile
, which defaults to ~/.config/git/ignore
.
You can see both of these uses with git help gitignore
.