-2

The main branch shall be called master or origin/master?

I think it is strange my repository has two different branches (master and origin/master). Actually I don't need both.

1) How shall I name my main branch and how to "merge" (?) both into one so that not to loose any commits?

2) Right now how can I give a link to my colleague so that he can git clone only origin/master contents (and not master or just all branches)?

Development statred from master branch, then it was continued in origin/master (there was a branch X from origin/master, then a branch Y from X and finally Y merged into origin/master which is now final)

P.S. I read this, it says local branch (on my PC) shall be called master and remote branch (on bitbucket) shall be origin/master (can also be referred to as remotes/origin/master) - so within Bitbucket.org origin/master is the correct one and I shall somehow unite (merge?) it with master (in Bitbucket) and delete master branch?

enter image description here

user10777718
  • 723
  • 4
  • 16

1 Answers1

3

local branch (on my PC) shall be called master

That's true.

remote branch (on bitbucket) shall be origin/master

No, that a major misunderstanding. The branch at Bitbucket should also be named master.

origin/master is not a remote branch, it's a remote-tracking reference. This reference exists at your local repository at PC, not at Bitbucket. The remote-tracking reference tracks the commit last synchronized (pulled or pushed) with Bitbucket, that is it points in your local repository to the commit the branch master at Bitbucket pointed to at the last pull/push time.

phd
  • 82,685
  • 13
  • 120
  • 165