this question has answer here:
- what “origin” in git? 7 answers
in git lingo, origin
, remote
same thing? or origin
refer local directory?
in case of git push -u origin master
: of following interpretation correct?
- "push upstream remote repo called 'origin' , branch 'master'"
- "push local originating repo called 'origin' upstream 'master' branch"
appreciate clarification!
the answers question clarified 2 issues me:
origin
refers remote repo, rather local cloned copy of remote repo. not clear when 1 readsorigin
is alias ofremote
, created @ time ofgit clone
origin
refers remote repo ingit push -u origin master
because local copies of repo implied , "rarely referenced".
in git lingo origin
default name remote repo cloned. might equally have been called source
or remote1
or remote
.
remember git
peer-to-peer, distributed system, not 1 built-in notion of client/server, master/slave, parent/child relationships (though these might imposed upon user in particular scenario).
all remotes equal. origin
(and literally) first among equals (for cloned repo). :)
and jan points out in comments, name associated each remote intended convenience. if find origin
not work can change it.
as interpretations of push
statement, first closest being correct push command written push local master
branch master
branch on remote identified (locally configured) name origin
.
if there no master
branch in remote 1 created.
full details of push command , flags, options etc of course in docs.
you (if ever) refer 'local' repo explicitly since operations performed in context of repo.
Comments
Post a Comment