Search code examples
gitrm

Remove file called --a from git


I accidentially created and committed a file called --a in my git repository. Using git rm --a obviously did not work. How can I remove this file?


Solution

  • You can use

    git rm ./--a 
    

    This can be used to remove any file with the name starts with '-'