0

Two files :ls and :ls.pub were removed with git rm

and my branch is clean

C:\dev\myApp>git status
On branch myApp-branch
Your branch is up to date with 'origin/myApp-branch'.

but when I switch branches, I am getting this error

C:\dev\myApp>git checkout myApp-branch2
error: The following untracked working tree files would be overwritten by checkout:
:ls
:ls.pub
Please move or remove them before you switch branches.
Aborting

I couldn't find the files anywhere locally or on the repo

TheIceBear
  • 2,912
  • 9
  • 23
  • 1
    If you removed files(using `rm -rf `) and git still see them it's because they auto generate themselves nut you can use `.gitignore` || `git stash` for not having issues with that files – itshosyn Aug 05 '21 at 15:43
  • The files still exist in *some other* commit; checking out that *other* commit would—because `git checkout` means *remove these files, check out those other files instead* —have to remove your *current* `:ls` and `:ls.pub` files. [Related.](https://stackoverflow.com/q/25392771/1256452) – torek Aug 05 '21 at 17:47
  • 1
    The thing *I* find confusing is that Windows in general won't allow files with colon in the names, so there should not *be* a `:ls` or `:ls.pub` file in your working tree. – torek Aug 05 '21 at 17:50
  • @torek this smells like the issue with files having a space at the end of the name, which was also not technically allowed by Windows, but worked anyway. – joanis Aug 05 '21 at 19:07

0 Answers0