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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

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,463,737
Community Members
 
Community Events
176
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

Atlassian Community Events