I would like to know what is the difference between git add
and git add --
.
After having tried them I have definitely not found any differences, but I have seen that some people, on some occasions, use one command or another, however I do not know how they really differ.
The commands:
Like:
And also like:
Of the last 2 you can check it by executing the following command in any project that is being monitored by git:
Which will show you between more commands a line like this:
Now the command
According to the git documentation it says
Which can be translated as:
References
Well according to the documentation found on the internet and the help of the commands themselves in the terminal,
is used to add the files from the current directory where you are to the stage zone, and if you write
It will serve you the same as putting the point . At least as far as I know from my own experience and seeing answers to questions similar to yours. I think in the end the one that is most comfortable and fastest for you.
If it helps, for more info look at this answer given in the stackoverflow in English https://stackoverflow.com/a/26039014/10515716
The difference would become obvious if you had a file that is called as an option that can be passed to git.
The logic is simple... and it applies to many other commands, not just git. The
--
is used to tell a command that it's out of options and what comes (usually) are file names. For example: