Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

My git branch is showing 'origin/master' and 'origin/HEAD' in Sourcetree and I don't know how to merge the two

I recently merged a branch I was working on with the 'master' branch. I must have (still kind of a git n00b) done something when pushing or pulling that created both an origin/master and an origin/HEAD branches. Unfortunately, I didn't keep a record of what commands I ran that did this. Currently, my team has a bunch of code in their master copies that I'm not getting when I check out the project (even if I clone to a new location).

Here's a screenshot of what Sourcetree is showing:

2 branches

I really need to get this resolved so I can keep working so any help will be greatly appreciated.

like image 773
Zachary Abresch Avatar asked Jul 17 '12 16:07

Zachary Abresch


People also ask

How do I merge master into branch in Sourcetree?

The correct way is to 1> checkout master 2> click merge 3> select all branches in the drop-down menu. The step 3 is important otherwise. 4> select the develop branch then click OK. You can also do the same thing in the reverse order.


1 Answers

It is just a pointer to master, a symbolic link if you wish. You can safely delete it by doing the following in a terminal (or git bash/cygwin for windows users):

  1. navigate to your repository
  2. execute: git remote set-head origin -d

now it should be gone:

$ git branch -r
origin/master
like image 108
Gabriel Avatar answered Sep 19 '22 15:09

Gabriel