Git will not allow me to reinstall (not verified files will be overwritten). What should I do?

I just want to edit / change the text of an older Git commit.

I ran the following:

$ git rebase -i a41a407d6f53328d49267e6a8429b9492f023629 error: The following untracked working tree files would be overwritten by checkout: admin/roles/allowassign.php admin/roles/allowoverride.php admin/roles/assign.html admin/roles/assign.php admin/roles/manage.html admin/roles/manage.php admin/roles/managetabs.php admin/roles/override.html admin/roles/override.php Aborting could not detach HEAD 

However, git status does not list any files without a trace:

 $ git status On branch dev nothing to commit, working directory clean 

Note that admin / role is a submodule of the repository:

 $ git submodule 77c5addc1b210256da9171e3b286ffa5addd2478 admin/roles (heads/dev) 

And listing the ignored files:

 $ git status --ignored On branch duf-moodle-dev Ignored files: (use "git add -f <file>..." to include in what will be committed) blocks/moodleblock.class.php.bak filter/tex/mimetex.exe lib/smarty/COPYING.lib nothing to commit, working directory clean 

Saving Git stash has no result:

 $ git stash save --include-untracked No local changes to save 

I read that integration in Explorer Shell could have this result. Git extensions, the Git GUI, and SmartGIT are now integrated into the context wrapper. Could this cause problems?

My suggestion is that the occurrence of the problem is the use of submodules. I save some changes as submodules.

Any ideas why the interactive rebak gives an error and how to fix it?

Also, it would be nice to have a solution to edit / modify an older commit description without using rebase ...

+6
source share
3 answers

The solution was to remove the submodule from the main repo (unsupmodule). Then it was possible to perform a reboot.

+1
source

I spent a lot of time on this problem myself, when the following was returned to me:

 error: The following untracked working tree files would be overwritten by checkout: index.php ...... (too many lines) Please move or remove them before you can switch branches. 

In general, you just need rm files, and then checkout. You can also add and hide them. Perhaps first think about making the check look like this:

 git checkout --force master 

I can offer also a look. The following unprocessed working tree files will be overwritten by the cashier , which helped me a lot!

0
source

I had a similar problem, but in my case it was caused by replacing the letter case in file names when using Windows (which seemed to confuse him with git). I decided using virtualized Linux by checking this branch and doing rebase from there.

0
source

Source: https://habr.com/ru/post/984139/


All Articles