Confused about the Local Master and the Remote Master

I am currently using GitHub and I am trying to consider BitBucket instead, I see there is this community for questions.

My first question is why is there a remote master branch and a local master branch?  And after a feature branch is pushed to it's remote, are the commits merged with the remote master or the local master?

Thank you so much,

Josheir

1 answer

0 vote

Each clone of a given repo is meant to be more or less complete, and that means that each clone will have its own set of branches. The main difference between a local branch and a remote branch is where it's located: local is kept on your own system, and remote is kept someplace else (such as Bitbucket). A `git push` or `git pull` can help you synchronize the two, but otherwise they're independent of each other.

If you push a feature branch to a remote, then the commits are not on any master until you merge them. From there, the answer to "are the commits merged with the remote master or the local master" depends on where you perform the merge:

  • If you merge locally (i.e. with `git merge` on your own system), then the commits will be merged to local master. They won't appear on remote master until you push them.
  • If you merge on the remote (i.e. with the "Merge" button on the Bitbucket UI, or with `git merge` on the remote shell), then the commits will be merged to remote master. They won't appear on local master until you pull them.

 

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 12, 2018 in Bitbucket

Do you use any Atlassian products for your personal projects?

After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...

24,153 views 26 12
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you