git - Branch name clashes when pushing -


what think know

when clone or fetch remote repository, name of remote prefixed names of branches imported remote.
instance, if remote called origin in repository, after cloning remote's master branch called origin/master in repository.

this behavior makes sure there never name clashes between imported branches branches exist in repository (whether created locally or imported other repositories).

what don't know (i.e. question)

when push remote repository, repository name prefixed (in remote repository) names of branches pushed?

if not, how branch name clashes avoided?

what think know

when clone or fetch remote repository, name of remote prefixed names of branches imported remote.

for instance, if remote called origin in repository, after cloning remote's master branch called origin/master in repository.

its not this.
when clone git repository git reference branches master checked out

enter image description here

every time checkout branch git add track branch it

enter image description here

when push remote repository, repository name prefixed (in remote repository) names of branches pushed?

whenever type push git use internal mechanism called refspec

refspec

the format of refspec optional +, followed <src>:<dst>, <src> pattern references on remote side , <dst> references written locally.
the + tells git update reference if isn’t fast-forward.

more reading:
https://www.atlassian.com/git/tutorials/refs-and-the-reflog#refspecs


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -