How to force local files to be overwritten during git pull?
I have the following script:
- One of the colleagues makes changes to the templates of the website on which we work.
- He adds several images to the appropriate directory (but forgets to add them to the version control system).
- Then he sends me these images by mail.
- I add the images to the version control system and send them to Github along with other changes.
- An employee cannot update his version of a project from Github, because git does not overwrite its local files.
The error looks like this:
error: Untracked working tree file 'public / images / icon.gif' would be overwritten by merge.
How to make Git overwrite local files? The mentioned employee is a designer, and usually all conflicts are resolved by me manually: I watch the server to have the latest version of all files, that is, my colleague has to update local files on his computer.
Translation of the question “ Force Git to overwrite local files on pull ” @Jakub Troszok .