It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Sourcetree Push dialog does not show any branches

Git Pull dialog works fine.

However when I press the Push button, the Push dialog shows me an empty list of branches when I am expecting a list of branches available push_dialog.JPGto push

6 answers

1 accepted

10 votes
Answer accepted

In my case it was caused by an older version of git (prior to 2.13.0) not understanding the format option to git branch command. Upgrading to Git 2.23.0 solved the problem.

I am running 3.2.6 and have the same issue. Steps:

1. created repository on bitbucket.org.
2. cloned repository to local machine to an empty folder
3. copied files into the newly created folder where the .git directory was created
4. using SourceTree, staged all of the files
5. entered commit comment and clicked the commit button (lower right)
6. tried to Push commited files

Result - the push dialog with no branches listed and just a blue spinny for-ever.

This worked for me:

 

I tried upgrading the Embedded Git used by SourceTree  

(Tools => Options => Git => Update Embedded Git)

 

Thanks for the link

Like # people like this

But now I get this error when I try to push:

git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks push -v --tags --set-upstream <repository-name> master:master
Pushing to bitbucket.org/<my-name>
fatal: 'bitbucket.org/<my-name>' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

 

Completed with errors, see above.

 

where <repository-name is the name of the repository I am trying to commit to and <my-name> is the name added to the bitbucket url . Both exist at bitbucket.org.

I've tried both system git (updated to 2.23) and embedded git (2.21) and neither solved the problem for me. I'm having the problem with both ssh and file system origin repos.

Like Maddalena Barlotti likes this

I discovered a way to "fix" the problem that is probably also a clue for the bug.

If I set my new branch to track an existing remote branch (doesn't matter which branch) then immediately change it back to track "None", it then shows up in the push dialog.

Like # people like this

You're right, I have the same issue and upgrading Git didn't work, but the trick of tracking/untracking branches did it! Thanks a lot!

The trick of tracking/untracking branches worked for me also.

fgregoire I'm New Here Oct 08, 2019

The trick of tracking/untracking branches worked for me also.

It looks like Atlassian has made a new release of SourceTree:
https://product-downloads.atlassian.com/software/sourcetree/windows/ga/ReleaseNotes_3.3.4.html

 

Has anyone tested whether it fixes this problem of first time local branch not showing in Push Dialog?

https://community.atlassian.com/t5/Sourcetree-questions/Push-does-not-work-since-3-2-5/qaq-p/1152545?utm_source=atlcomm

I'd like to try it out, but can't find how to download version 3.3.4 of SourceTree.

3.3.4 doesn't seem to be officially released...yet.

This solution worked for me.

Like kadkin likes this

I tried in tool option and then it worked for me.

Capture.PNG

sajico I'm New Here Oct 17, 2019

This solution worked for me also.

My "System" Git installed by "Docker Toolbox" was "git version 2.9.0.windows.1".

Thanks for capture!

Same problem here, and this solution worked for me too!

Thanks!  Selecting system made it work.

Selecting the "Update Embedded" in the Tools > Options > Git dialogue worked for me.

Thanks. Solution worked for me too!!

Yes solved the issue. Thanks

Selecting Embedded and restarting SourceTree worked for me. Thank you.

Updating SourceTree or the embedded git didn't solve this issue for me.

Instead, I followed Jason Paulson's comment in a related thread:

- Check (Tools -> Options -> Git -> Push branches)

- Change this setting from "matching" to "simple"

Yay!...this is the real solution (at least for me).

Here's a little additional information on this issue that I discovered:

The underlying issue is that when using the "matching" setting, the SourceTree push dialog only displays branches that have [branch] entries in the .gitconfig file. My previous solution of manually setting and unsetting the remote tracking branch works because it's causing an .gitconfig entry for the branch to be created.

Like sonnyb likes this

My issue is when I tried to push the second time(the first time the branch showed up and I was able to push), the branch was not listed. So I updated embedded git, did not work. Then I changed Tools->Options->Git->Push branches from simple to matching. The local branch showed up. 

Like Rohit Singh likes this
Yi Han I'm New Here Jan 09, 2020

I had a similar problem, but changing simple(which was the default setting) to matching worked for me! XD

I tried a bunch of the suggestions here, but this is the one that worked for me - although, I changed the setting from 'simple' to mixed. I suspect therefore that the setting itself isn't the issue, but changing it triggers some kind of refresh.

GIT UPDATE solved this for me :)

0 votes

I branched local/[mybranch-didnotpush] to local/[mybranch-thiswillpush], and and pushed local/[mybranch-thiswillpush] to origin/[mybranch-didnotpush].  Then I deleted local/[mybranch-didnotpush], and renamed local/[mybranch-thiswillpush] to local/[mybranch-didnotpush].  Now local/[mybranch-didnotpush] does push.

had the same issue here on windows, switch git to embedded version works for me. 

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Sourcetree

Sourcetree for Windows - CVE-2019-11582 - Remote Code Execution vulnerability

A vulnerability has been published today in regards to Sourcetree for Windows.  The goal of this article is to give you a summary of information we have gathered from Atlassian Community as a st...

2,847 views 0 10
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you