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
- First Master Grade is coming along December 29, 2023
- Swapping Macbook battery May 22, 2022
- 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
Archives