Remove a file with a strange name from git

前端 未结 3 1819
感动是毒
感动是毒 2020-12-10 14:31

I have a file that managed to get itself named:

# file\'s name (both lines)
companies.yml
companies.yml

# entry in my git working tree
"test/fixtures/co         


        
3条回答
  •  长情又很酷
    2020-12-10 15:16

    I wanted to remove a folder in my git repository that had name containing Russian letters: "Файлы Mail.Ru Агента". First I deleted the folder manually and wanted to delete it in git with

    git rm "..."
    

    command in the next step. But git showed me a very acryptic name of the deleted folder: "\320\244\320\260\320\271\320\273\321\213 Mail.Ru \320\220\320\263\320\265\320\275\321\202\320\260". I restored the folder with

    git checkout
    

    and than just copied the name of the folder and executed command

    git rm "Файлы Mail.Ru Агента/*"
    

    It worked!

提交回复
热议问题