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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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

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
Posted in Sourcetree

[dev team] Sourcetree for Windows 2019 Preview - Dark Theme

Hi folks, While the full post is over on our blog I'd like to share the dark theme we've got planned for 2019 here directly as well to keep the discussion going.  The ...

3,252 views 19 18
Join discussion

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