Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Duplication of branch names

ntom9 September 13, 2017

Hi folks,

Not sure if I am the only one afflicted by this, so here goes...

For some reason, in 3 out of the 5 repos I work agains, all branches double up.  The other 2 present as you'd expect.

The below is a normal display, showing a bunch of branches:

tab1.PNG

tab2.PNG

tab2.PNG

tab2.PNG

tab2.PNG

 

13 answers

1 vote
Johan Nicander
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 21, 2018

I had the same problem.

For me the problem occurred when I created a new branch.
I noticed that the newly created branch in the config file had remote set to . (period).
I changed it to origin, which for me was what it should be. 

This solved it.

FIY, when I change it back the duplication returns.

Tara McGrew June 23, 2018

Excellent, I've been having the same problem and that fixed it.

Dave Newman November 27, 2018

This is eventually what fixed it for me as well. Not sure how the dots were inserted where it should have been origin, but editing them all to say 'origin' fixed my duplication issue.  Thanks!!

1 vote
Brendan Simon December 29, 2017

I had the same issue but I fixed it :)

I noticed that `git branch -l` gave me an error message, but `git branch -r` worked ok.

The error message was:

$ git branch -l
fatal: missing object 791838d65fcfc7295dea5ebf2eae468d10f066bd for refs/heads/issue/BB#69_convert_everything_to_python

 

This branch has actually been merged.  Actually, a new branch may have been created, and then squashed, and then merged.  The branch is deleted (not in config file) but there was a still a referenced to it.

After manually deleting the reference in the console, displaying local branches now work and the the duplicated branches in ST disappeared :)

$ rm -rf refs/heads/issue/BB#69_convert_everything_to_python

:)

Felix von Zadow
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 25, 2018

`git branch -l` shows no error no error for me, just every branch once. Sourcetree still displays 4 of 5 branches twice.

0 votes
janpio November 24, 2018

I had the same issue for some time. I could solve it by deleting a local branch whose name was set up to create a folder. Branch deleted, duplication gone. Maybe this works for one of you as well.

0 votes
Afkakawata
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 24, 2018

I got this same problem after I deleted a branch (in repository and local) all my local branches were duplicated. 
I never realized I had another local branch pointing to that same deleted branch.

I went to Settings > Edit Config File...     there I saw:

[branch "another_Local_Branch"]
remote = origin
merge = refs/heads/deleted_Branch

I closed the Edit Config file > Right Click in "another_Local_Branch"> Delete "another_Local_Branch". That's it, after it refreshed the UI repository (F5) all branches  are single now. 

0 votes
Barry Barney
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 10, 2018

No answers but - FWIW same issue here. SourceTree version 2.6.3.0 on Win10 Prof. 

I cloned a completely new copy of my project. This gave me one instance of the "master" branch showing in SourceTree. And it remained that way until I used Arcanist to create a new branch ("arc feature foo"). The new branch was created and I now have two instances of "master" showing in the left panel of SourceTree. 

Git commands suggested above and examining the configuration files reveals no obvious (to me) reason why two entries are now showing.

Barry Barney
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 12, 2018

I just deleted the experimental branch mentioned in my prior comment:

git branch -D foo

And now SourceTree is back to normal, showing only one entry named "master" in the left panel's list of branches.

0 votes
Antero Karttunen
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 28, 2018

I had this problem too after changing other branch to track remote master.

For some magical reason, this fixed the problem for me:

I went to settings > Edit Config File...

Noticed that for some reason I had two master branches defined.
One with name "master" and one with name "origin/master".

When I removed the origin/master entry from configuration file, all the duplicates vanished.
Not sure if sourcetree just picked up the new config after modifying it a bit..

Just to be safe, don't just repeat blindly the steps I did :D

Dave Newman May 30, 2018

Apparently there are numerous ways to confuse the SourceTree...  I checked my config file and I do not have that same situation, but I still have duplicate entries.

ntom9 May 30, 2018

You're spot-on: in my experience, this config file is the key to the riddle.

I did an experiment with a couple of my repos, whereby I removed the "config" files from the .git folders where they live.  Ok, not quite removed, but renamed them in a way that made sure they were not coming into play when SourceTree was starting (but I could have them back if it all went to hell...)

Three things happened when I restarted SourceTree:

  1. The duplicated branch names disappeared, leaving only a single copy of each branch.  The way it's meant to be!
  2. SourceTree set up new config files, much smaller than the original and with no branch information in them.
  3. SourceTree lost all knowledge of my remotes.  Meant I couldn't push/pull my commits.  But it was painless to simply add them again in the normal way through the Setting dialogue.

After all that, things are humming along fine.

Hope this helps someone.

Cheers,

-Neven.

0 votes
Felix von Zadow
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 25, 2018

One observation: 4 of my 5 branches are displayed twice. The one that is displayed only once, is the only one for which there is no remote branch of the same name.

It looks a bit like this:

BRANCHES
a
a
b
b
master
master
c
c
d <-- no remote branch with this name exists.

REMOTES
origin
a
b
master
sandbox
user1
c
user2
e
f

Don't know if this is relevant.

0 votes
Justin Boyson
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 3, 2018

Deleting and re-cloning the repo got rid of the duplicates for me. Not really a "solution" but it did get rid of the problem.

0 votes
Brendan Simon December 29, 2017

+1.  I am seeing this too.  Have been putting up with it for a while now hoping that an upgrade would fix it.  It's distracting and disconcerting.

I'm fairly certain it happened with a ST update, but can't tell you exactly which one.

My symptoms are similar to above, but not exactly the same.

I have branches called:

     * issue/BB#22_alarm_stuck_on

    * issue/BB#75_dst_rollover_unit_tests

    * bjs/python_experiments

    * bjs/wxglade_experiments

    * master

    * master-next

The branches that are in a "folder" (have forward slash in name) seem to be duplicated in the ST UI, however top-level branches (without forward slashes) are not duplicated.  e.g. `master` and `master-next`

0 votes
Tjaart Blignaut
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 27, 2017

I'm also getting this. I even tried to reinstall sourcetree but no luck

0 votes
Dave Newman October 17, 2017

Just for the record, I am seeing this as well. I have 5 projects and 1 of them exhibits this behavior. The only difference between the ones that work correctly and this one that has duplicated branch names is I am using Visual Studio 2015 on the outlier, VS 2017 on the others.

Dave Newman November 27, 2018

My repository is fixed now, see separate reply to comment about '.' vs 'origin' in the config file...

0 votes
ntom9 September 17, 2017

Thanks Michael,

Sorry for the messed-up posting, not sure why the one screenshot got pasted several times.

So, using v2.3.1.0 (latest) on Windows 7.

I have 4 Gitlab repos that I connect Sourcetree to.  The 4 repos are much the same: nothing about any one of them is inherently different to the other 3 in terms of credentials, git, etc. Certainly, they are all configured to connect to Sourcetree in the same way.

Of the 4, 1 behaves itself while the other 3 duplicate every local branch.

Some things that may be relevant:

(1) Have recently upgraded the Sourcetree.  Would have been 2 if not 3 versions behind.  But the duplication was already there.  I upgraded in the hope that it would make it go away.

(2) I culled a lot of old local branches from all 4 repos that were "clutter" as far as I was concerned.  That didn't help: whatever branches are left are duplicated.

(3) If I click on Branch, and pretend I want to delete a local branch, the list of branches I am offered has no duplication.  So, at least one part of the system "knows" that there really is only one version of each local branch.  See the screenshots below...

Capture1.PNG

vs

Capture2.PNG

minnsey
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 28, 2017

So Sourcetree will run the following the get the branch information

>git branch --no-abbrev -v

I'm assuming if you run that in the terminal you do NOT see any duplication of branch names?

Dave Newman November 28, 2017

No such luck. I ran the command as given and still see the saem duplicated branch entries. Restarting Sourcetree doesn't help.

Dave Newman November 28, 2017

That's same, not saem...

ntom9 November 28, 2017

Hi Michael,

Yes, you are spot on: running the command from the terminal returns no duplication.

It feels as though the UI (and only the UI - not the underlying git/repository mechanics) are affected.

Cheers,

-Neven.

minnsey
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 29, 2017

OK, thanks for the info, we can investigate.

0 votes
minnsey
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 14, 2017

Hi

We've not experienced that, is there anything significant about the repos that have the problem?

Is there any duplication of information about them in Sourcetree e.g. the same names etc

Trying to understadn the environment to see if we can reproduce it.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events