Skip to main content
Select a theme to activate music mode, and use your keyboard to play a tune.

Git's local-only ignore file

TIL about the .git/info/exclude file. It can be used to ignore files for your local repo without requiring you to list the file in the shared .gitignore.

I've been using this to have a custom (and personal) .github/copilot-instructions.md file which is specific to me and not something there would be any benefit in sharing more widely. I don't want to add the file to the committed .gitignore since, at some point in the future, we might want to have a shared set of Copilot instructions and it may not be immediately obvious that the file is ignored.

Adding a file to your local-only ignore is as simple as appending it to the .git/info/exclude file, which you can either do manually or with the following one-liner.

echo ".github/copilot-instructions.md" >> .git/info/exclude

Have fun!