RamValli
RamValli

Reputation: 4475

Re-do the ignoring of ".gitignore" file

In a git repositry, I have ignored few files.
I have also ignored the .gitignore file.

Now the problem is when ever I checkout different branches and come back to the same branch (lets say bug-fix branch) I had to again ignore all the files. (I use SourceTree to select the files and ignore either by directory or by extension).

So when I tried changing that, .gitignore file in the repository doesn't contain .gitignore in it. And either the exclude file didn't have it (Actually its empty!). And there is no .gitignore file present in the user folder. How can I track the .gitignore file ?

Update: Contents of .gitignore file in repository:

*.classpath
*.project
.settings/

Upvotes: 1

Views: 71

Answers (1)

VonC
VonC

Reputation: 1329672

I have also ignored the .gitignore file

Don't. I understand your .gitignore file does not include any exclude directive for itself, but ignoring the file through SourceTree means either your global gitignore config (in ~/ or $HOME) or your local <repo>/.git/exclude file (or, in your case, or a SourceTree-specific gitignore file) is modified, to ignore the .gitignore itself.

To know which one, do a:

cd /path/to/my/repo
git check-ignore -v -- .gitignore

Upvotes: 4

Related Questions