After git reset --hard HEAD, git pull still says: Corrected working tree file ... will be overwritten by merge

After git reset --hard HEAD, he git pullsays: The corrected working file of the tree ... will be overwritten by merging

any ideas?

I tried git fetchand git fetch --allalready ...

+5
source share
5 answers

If you just want to update the local state in its original state, you can use the solution described here :

$ git fetch origin

$ git reset --hard origin/master
+8
source

you have unprocessed files. Simply

git stash -u

stash (-u , ). , , , - ,

git stash pop

.

+7

. , git clean -fd. , , git stash -u, stash. stash, git stash pop.

+1

(un git add files). git reset.

, :

git add -A
git stash
git pull
git stash apply

stash similar to a repository where you can temporarily add files without commenting on them.

0
source

The reason this happened in my repository was because another developer deleted the / directory from the main repository and moved it to the submodule. This particular repository has not been used for a long time, so another developer moved the directory to a submodule between the time the repo was last used and today, when the problem arose.

In this case, it is normal to simply delete offensive irreproducible files.

0
source

All Articles