-
Notifications
You must be signed in to change notification settings - Fork 0
Ignore Files and Folders
Edit the file:
-
.git/info/excludeto ignore files that exists only in your local repository. (for example temporary files generated by a local smoke test you are the only one to use)..git/info/excludeis not under version control. Use it to ignore files specific to your local configuration. -
.gitignoreto ignore files in your local repository and in any clone of your repository. (This file contains files (and folders) ignored by default for anyone cloning (or pulling from) this repository).gitignoreis under version control and shared by anyone using the repository. Once commited and pushed to the repository, file exclusion configured in.gitignoreapplies to whoever uses the repository.
The exclusion rule for a file/folder must be added in either of these files, before git begins tracking it.
If you need to ignore a file after git started tracking it, see git update-index --assume-unchanged below.
You can also define a global gitignore file that will apply to whatever repository.
git config --global core.excludesfile ~/gitignore.globalGithub contains a list of per language gitignore file templates: https://github.com/github/gitignore/tree/master/Global
Use it as an inspiration as to what to put in ~/gitignore_global.
List the ignore/exclusion rules as defined in .gitignore and .git/info/exclude.
git status --ignored
.agignore
.bundle/
.idea/
public/docs/.DS_Store
tagsIf you have trouble remembering the above command, you use create this handy alias:
git config --global alias.ignored "status --ignored"
# From now on you can use the following instead
git ignored