user3814030
user3814030

Reputation: 1283

git merge fails refusing to lose untracked file

I am trying to merge a repository on the master. I am getting the following error.

error: refusing to lose untracked file at 'config/database.yml'

git status gives me

deleted by us:   config/database.yml

How can I resolve that ?

Upvotes: 12

Views: 6496

Answers (1)

Makoto
Makoto

Reputation: 106460

From what you're describing, the database.yml file just shouldn't be in your repository anymore.

Perform git rm --cached config/database.yml to remove it from Git, then attempt your merge once more.

Upvotes: 10

Related Questions