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?
Asked
Active
Viewed 80 times
2
Lars Noschinski
- 3,667
- 16
- 29
floriansuchan
- 255
- 4
- 13
2 Answers
7
Try
git rm -- --a
The -- helps separating the command from the parameters
See more on the double hyphen syntax in "Deleting a badly named git branch".
4
You can use
git rm ./--a
This can be used to remove any file with the name starts with '-'
nirajkumar
- 335
- 1
- 3
- 14