Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,295,503
Community Members
 
Community Events
165
Community Groups

Source tree cannot see feature branch created from a project branch

Hi, 

A clone of a project branch was made to my local drive and opened using Sourcetree. I then created a new feature branch from this project branch in JIRA and both branches are hosted in Bitbucket. However, Sourcetree seems unable to see the remote feature branch at all. I tried 'git fetch' , 'git checkout <feature_branch>'but still could not get the feature branch show up in Sourcetree. 

I tried both Sourcetree and git command but neither worked. When I click 'Checkout in Sourcetree' next to the name of feature branch in Bitbucket, there is an error message showing 'origin/feature_branch is not a commit and a branch cannot be created from it'. 

Could you please suggest what I need to do to to get the feature branch created from a project branch?

Thanks.

Xintong

1 answer

0 votes
minnsey Atlassian Team Apr 06, 2018

Hi

Can I ask where you see the origin/feature_branch is not a commit and a branch cannot be created from it error, in Sourcetree or Bitbucket?

If from the command line/terminal you run

>git branch

You will see a list of all the local branches you have checked out.

If you run 

>git branch --remote

 

you will see a list of all the branches available on the remote.

Can you see the branch you want in the remote list?

If it is you should be able to check it out

see https://www.git-scm.com/book/en/v2/Git-Branching-Remote-Branches

Hi Michael, 

Thanks for your reply. 

I saw that error message in Sourcetree after clicking 'Check out in SourceTree' (in a dropdown) next to the feature branch name in Bitbucket. Please see attached screenshot.

git branch --remote does not show this feature branch in Bash, although the branch shows up in Bitbucket. 

The feature branch also does NOT show under REMOTES/origin in Sourcetree (left panel).  Only the master branch is there. 

 

bitbucket.jpg

minnsey Atlassian Team Apr 06, 2018

That sounds odd.
Are all other branches visible apart form this one?
Are there any permissions at work?

I just created a new feature branch from the project branch for another JIRA ticket. I can see it in Bitbucket, however still the same, git branch --remote can only see the project branch but cannot find this new feature branch. And this new feature branch does not show up in REMOTES/origin in Sourcetree.  'Check out in Sourcetree' as mentioned above showed the same error message... 'this is not a commit and this branch cannot be created.' 

BTW, I do not think there is a permission issue. Alternatively I found I could use git checkout -b feature-branch to pull it down to local repository. But just let you know the issue is still there. 

This just happened to me to. Bizarre. Appears in Branches page of web UI, but no amount of `git fetch` would have it appear in VS's Team Explorer listing of branches, and trying to do `git checkout` would say "error: pathspec 'branch-name' dit not match any file(s) known to git".

 

Went for -b above and will see how I go pushing it back up.

Suggest an answer

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

Bug Fix: Sourcetree for Windows authentication error when updating to app password

Hello Sourcetree users!!! With the recent removal of Bitbucket Cloud account passwords for app passwords (please see our Bitbucket Cloud community post for details on why we made this change for se...

61,049 views 127 27
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