gitversion-control

What does `git fetch origin master:master` mean?


What does git fetch origin master:master mean?

I mean the master:master part: I know what git fetch origin means, but what about the master:master part?


Solution

  • The arguments after the remote (origin) are refspecs.

    Using master:master will overwrite your master branch; see this answer.

    See this answer for even more about git fetch's behavior with and without refspec arguments.