Todd
Todd

Reputation: 3009

Git repo contains target directory

Our company just moved to Git. It now appears we should have sorted out our .gitignore file before starting to check code in. We now have several projects in the Git repo, including their Maven target directories (i.e. build directories).

I've run

git rm --cached <target dir path)

as well as adding

target/

to my .gitignore

However, whenever I pull, I'm still told there are unresolved merges with files in the target directory. I suspect what needs to happen is that EVERYONE drawing code from the repo must do those same two steps in order for me to stop getting the unresolved merge messages. Is that correct? Or, is there something else that needs doing?

Upvotes: 1

Views: 345

Answers (1)

VonC
VonC

Reputation: 1329262

I would recommend:

git rm --cached -r target/

to be sure to remove from the index all files within target directory.

Then, as commented above, commit and push.
That modification will naturally propagate to other downstream repos, as thay will have to pull first (accepting your changes) before pushing.

Upvotes: 3

Related Questions