Git rebase on Windows sometimes fails with the inexplicable "error on your raw working tree will be overwritten"

This is something that sometimes affects some of our developers when they try with rebase. For example, after making 5 commits at the local level, and they run:

git pull --rebase origin master

to make their story linear before clicking. In most cases, this works fine, but from time to time, during the "Reuse your commits" stage, around several attempts, rebase will stop with an error:

The following untracked working tree files would be overwritten by merge

and list the files that were changed by commit (s) that have already been applied.

I saw several posts about this issue, such as this question , but they all talk about OSX, and we are on Windows. Nevertheless, we tried to establish:

git config --global core.trustctime false

but it did not help. We made sure that the antivirus does not control the directories managed by the source, and there are no backup programs that are not running ... nothing should touch these files during the redirect operation.

Has anyone else encountered this problem and found a reason?

+3
source share
1 answer

Can you make sure there are no files without a trace. If they are present, you need to git checkout them first before doing git rebase.

Best practice would be to follow these steps.

Assuming you have a new cloned git repository

.

git checkout -b <MyLocalBranch>

. .

git add .
git commit -m <message>
git review/push

, git pull

git checkout master
git pull

.

git checkout <MyLocalBranach>
git rebase -i master

. , , , .

0

All Articles