vico
vico

Reputation: 18175

Ignoring files without editing .gitignore

I have cloned project with it's .gitignore. Then I have placed some directories with files in it used for specific testing purposes. I don't want commit these directories to remote repository but I also don't place strange directories and files names to .gitignore in order not disturb other developers who will read .gitignore. How to solve such problem?

Upvotes: 1

Views: 595

Answers (3)

Juuuuuu
Juuuuuu

Reputation: 135

You might want to create a local .gitignore_global file for this purpose. With this file you will be able to ignore your tests files for this project and the next ones.

  • Create a file here: ~/.gitignore_global
  • Add your ignored files in it.
  • Then then run this command: git config --global core.excludesfile ~/.gitignore_global

More informations here https://help.github.com/articles/ignoring-files/#create-a-global-gitignore.

Upvotes: 0

dwaskowski
dwaskowski

Reputation: 425

Probably each IDE have option for exclude some folders, for example into PHP Storm you can use option Mark Directory as Excluded.

Also before commit you can add only files which should be commited, using:

git add name_of_file1 name_of_file2

Upvotes: 0

Vampire
Vampire

Reputation: 38619

There are multiple levels of git ignore configurations. You can e. g. edit .git/info/exclude and define your excludes there. You can also make a user-specific excludes file that is then in effect for all or your git repositories, ...

For more info read man gitignore.

Upvotes: 3

Related Questions