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 merge overwrite untracked files
  • git pull force overwrite
  • LO6U
  • liftngo
  • jobdbk
  • https://yandex ru/clck/jsredir?from=yandex ru;search;web;;&text=&etext=1841 c4DOMN0xStFrERoNP6awTnL5KMwoTSxzNT8roH8avGtcTBbtqPnycE2AHaJTHyQx ad2537efcaabf8fb31d7faddd9da251231727786&uuid=&state=_BLhILn4SxNIvvL0W45KSic66uCIg23qh8iRG98qeIXme
  • https://yandex ru/clck/jsredir?from=yandex ru;search;web;;&text=&etext=1835 U4iPfHLvWaDLD_f2fhKTfJCvw2nSIsCw9tCxnFiHWZkMVqV_F8Yr2BM5X6xvyWcN a9e6b06b0121a82384e2ce6fec08ace0a8d2cd31&uuid=&state=_BLhILn4SxNIvvL0W45KSic66uCIg23qh8iRG98qeIXme

Comments

  1. By oci

    Reply

  2. By sona

    Reply

Leave a Reply

Your email address will not be published.