If you add ‘–‘ to your git command, git will know not to process anything after the double hyphen as a command-line argument.
This was useful to know for the situation I just found myself in. I had accidentally cloned a repo into a directory called “–force”. I had placed the –force argument in the wrong sequence in the clone command. But when I went to remove it from git, I found I could not. Every ‘git rm --force
‘ command was throwing up the usage guide for the rm command; git thought I was passing in ‘–force’ as an argument. I found out about using the ‘–‘ argument with git and ‘git rm -- --force
‘ got rid of my bad directory.
Subscribe (RSS)
-
Recent Posts
- Enabling git CLI tab autocomplete on M1 Mac April 6, 2022
- Screaming at my ISP December 11, 2021
- Running Linux on an old Macbook September 24, 2021
- Two Unitys, One Project March 26, 2021
- Functional 3D print December 14, 2020
Archives