Git – Force Overwrite of Untracked Working Tree Files

GitWhen it comes to version control, I prefer Subversion over Git.

This is for several reasons:
1) Subversion is easier to use
2) The software that interfaces with SVN is generally simple and well-polished
3) It’s what I know the most

With that said, I do believe that Git has the most capabilities.

Why am I saying all of this? Well, just like my other posts, it’s related to what I’ve been working on. We’re using Git for version control and because the repo is directly modified sometimes (never recommended), we’ll occasionally get an error similar to the below one when doing a git pull:
Error: Untracked working tree file ‘xxxxx’ would be overwritten by merge.

In our particular case, we want to overwrite these files. So what do we do? We use the following:

git fetch --all
git reset --hard origin/master

This grabs the latest repository files without merging and resets the master branch and overwrites the modified ones.

Incoming search terms:

  • the following untracked working tree files would be overwritten by merge
  • error: The following untracked working tree files would be overwritten by merge:
  • The following untracked working tree files would be overwritten by checkout
  • git checkout the following untracked working tree files would be overwritten by checkout:
  • error: Untracked working tree file would be overwritten by merge Aborting
  • jobdbk
  • liftngo
  • minutejv6
  • https://yandex ru/clck/jsredir?from=yandex ru;search;web;;&text=&etext=1841 c4DOMN0xStFrERoNP6awTnL5KMwoTSxzNT8roH8avGtcTBbtqPnycE2AHaJTHyQx ad2537efcaabf8fb31d7faddd9da251231727786&uuid=&state=_BLhILn4SxNIvvL0W45KSic66uCIg23qh8iRG98qeIXme
  • summerfh6

Comments

  1. By oci

    Reply

  2. By sona

    Reply

Leave a Reply

Your email address will not be published.