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 ?
You have to add the untracked files of the repository by using the “git add” command and run the “git stash” command to save the untracked file and clean the current directory for working by removing the untracked file from the repository folder.
Untracked files are files that have been created within your repo's working directory but have not yet been added to the repository's tracking index using the git add command.
@AayushNeupane git is not going to do anything with untracked files, they are untracked means git is not tracking them, so no git command can do anything to the untracked files.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With