DEV Community

Discussion on: 10 Git Tricks to Save Your Time and Sanity

Collapse
 
nagrass profile image
Nathan Grass

What is the purpose of -- in the first command? Seems an unnecessary argument.

Collapse
 
jacobherrington profile image
Jacob Herrington (he/him)

It is kind of superfluous. It is just a more formal way to indicate that you are specifying the file name. I included it here in case someone took the example and made an alias out of it.

Imagine you had a file called master and you wanted to check that file out, git checkout master would probably do something different than you wanted, but git checkout -- master would check that file out from the current branch.

Collapse
 
jessekphillips profile image
Jesse Phillips

It signifies the end of command options. It is useful with transferring control to sub commands. In D you can provide compiler options then pass arguments to the compiled program.

Dmd run foo.d -- --verbose

D will compile foo then call

foo --verbose