Skip to content
Permalink
master
Go to file
 
 
Cannot retrieve contributors at this time
15 lines (12 sloc) 806 Bytes
title date comments tags
Ignoring files in git, but only locally
2016-05-03 11:50:00 +0100
true
git

I love git for one main reason: there are enough advanced commands to make nearly any problem find a solution. Ignoring some files, but only in your repository, is one of those.

For example, when doing terraform, I sometime set development-time variables in the terraform.tfvars file that exist for that exact purpose, say for my AWS credentials, and I really don't want the file to be committed. All the same, I probably don't want to be adding that file to the ignore list for everyone, which is the .gitignore file.

Instead, you can add your ignore to .git/info/exclude. I tend to do that from the command line.

$ echo 'myfolder/terraform.tfvars' >> .git/info/exclude
You can’t perform that action at this time.