AgmLauncher
AgmLauncher

Reputation: 7270

Can you have multiple gitignore configurations for same directory?

Say I have a staging area that has some additional files necessary for the staging area, that I don't want in my repository. Nor do I want to actually include those ignore patterns in the shared .gitignore file.

Ideal what I'd like to do is have a kind of "local only" .gitignore for just that environment, in addition to the shared .gitignore. Is that possible to do?

Upvotes: 4

Views: 900

Answers (1)

VonC
VonC

Reputation: 1325137

Yes, you can use:

$GIT_DIR/info/exclude
.git/info/exclude

It is local to the repo, and won't be pushed.
It works for untracked files.

The other approach to ignore files (already versioned) temporarily would be

git update-index --skip-worktree -- [<file>...]

Upvotes: 5

Related Questions