Skip to content

Instantly share code, notes, and snippets.

@arnaudbos
Created July 13, 2016 08:30
Show Gist options
  • Select an option

  • Save arnaudbos/0cfcb5e023ba68603883f187a610e5c4 to your computer and use it in GitHub Desktop.

Select an option

Save arnaudbos/0cfcb5e023ba68603883f187a610e5c4 to your computer and use it in GitHub Desktop.
Ignoring locally-generated files
If you don't want to create a .gitignore file to share with others, you can
create rules that are not committed with the repository. You can use this
technique for locally-generated files that you don't expect other users to
generate, such as files created by your editor.
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.
# Exmple file .git/info/exclude
#
# git ls-files --others --exclude-from=.git/info/exclude
# Lines that start with '#' are comments.
# For a project mostly in C, the following would be a good set of
# exclude patterns (uncomment them if you want to use them):
# *.[oa]
# *~
# For ignoring dist/ folder locally but not on build server for instance
dist/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment