Question

I would like to do a git pull to the production server but I'm having some issues.

Someone deleted a tracked file on the server and also modified a file on the server. The server also adds untracked files that it uses for logs and such.

I would like to do a git pull that will override all tracked files and keep untracked files in tact.

Right now when i do a "git pull origin master" I get the following:

error: Your local changes to the following files would be overwritten by merge: free_profile.php

I've found this on stack overflow: Git force overwrite of local tracked files but not local untracked files

But I'm not sure if this is the appropriate solution. It's a production server so I need to make sure I'm doing the right thing.

Was it helpful?

Solution

Do you mean someone deleted a file, but not yet committed, and you want to retrieve it?

If so, please try to use

git checkout -- your_deleted_file

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top