I have some files on a folder which I didn't want git to track, so I added them to the `.gitignore` like so:

```
Directory/Build/

```

but when i was using `git status` they were still shown as "modified files not staged for commit". I looked this up and it was suggested to clean the git index using:

```
git rm --r --cached Directory/Build/

```

I did this, and after `git status` all the files that I wanted to have untracked were shown as `Deleted: file`, I thought this was good enough as they will be deleted from the working tree (but not locally I think?).

But then when I tried to do `git pull` I got some weird merge conflicts that I do not know how to resolve:

```
error: refusing to lose untracked file at 'Directory/Build/..../file.class'
error: refusing to lose untracked file at 'Directory/Build/..../file.jar'

```

and also some

```
CONFLICT (modify/delete): ...
CONFLICT (modify/delete):  Directory/Build/..../file.jar deleted in HEAD and modified in <<id>>. Version <<id>> of Directory/Build/..../file.jar left in tree.

```

I tried to do `git merge -Xours` but it still gave me the conflict.

How to resolve?