epi4
epi4

Reputation: 397

.gitignore in Ubuntu is not applied

I am setting up a new repository and I have the following in the .gitignore file:

*.pro.user
*.o

However, when I do git status am seeing those ignored files listed. What is more, I am not able to add the .gitignore file in the repository, when I write : git add .git/.gitignore . How is this supposed to work?

Upvotes: 2

Views: 754

Answers (2)

Mark Adelsberger
Mark Adelsberger

Reputation: 45649

The .gitignore file does not go in the .git/ directory. Move it to your worktree root and it should work (and you'll be able to commit it there).

Upvotes: 4

Nils Werner
Nils Werner

Reputation: 36765

The .gitignore file goes into your repository workspace (outside, and next to .git/), not into .git/.

Upvotes: 8

Related Questions