Git ignore files only locally

De openkb
Aller à : Navigation, rechercher

Sommaire

Questions

Can I ignore files locally without polluting the global git config for everyone else? I have untracked files that are spam in my git status but I don t want to commit git config changes for every single little random untracked file I have in my local branches.

Answers

http://git-scm.com/docs/gitignore http://git-scm.com/docs/gitignore

Patterns which are specific to a particular repository but which do not need to be shared with other related repositories (e.g., auxiliary files that live inside the repository but are specific to one user s workflow) should go into the $GIT_DIR/info/exclude file.

The .git/info/exclude file has the same format as any .gitignore file. Another option is to set core.excludesFile to the name of a file containing global patterns.

Note, if you already have unstaged changes you must run the following after editing your ignore-patterns:

git update-index --assume-unchanged [<file>...]

http://ftp.kernel.org/pub/software/scm/git/docs/git-rev-parse.html http://ftp.kernel.org/pub/software/scm/git/docs/git-rev-parse.html

Source

License : cc by-sa 3.0

http://stackoverflow.com/questions/1753070/git-ignore-files-only-locally

Related

Outils personnels
Espaces de noms

Variantes
Actions
Navigation
Outils