3 ms·
What does -- do exactly?
by scotty79 5y ago
What does -- do exactly?
- bicolao 5y ago-- in git is usually used to mark the end of options. After --. --foo means an argument --foo, not the option --foo. Git checkout and a few other commands also use it to separate branch and the rest of paths, because you could specify like this git checkout branch path1 path2 git checkout path1 path2 git checkout branch # what if there's a file named "branch"? -- help disambiguates that by being between the branch and the paths, so git checkout branch -- # always checkout a branch git checkout -- path1 path2 # always checkout paths git checkout branch -- path1 path2 # same, but disable disambiguation logic
- MawKKe 5y agoit is used for that purpose in many other tools as well (grep, for example)