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 78 times
2
Lars Noschinski
- 3,637
- 15
- 29
floriansuchan
- 233
- 4
- 11
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