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
Community Members
Community Events
Community Groups

Getting error with git: fatal: reference is not a tree


We have been creating branches for a long time now (1 year or so) using the Bitbucket web site. After this I would do a git fetch using Git Bash (tortoise) which will identify that there is a new branch and after that I can do a git checkout mybranch

All of a sudden, I create new branches (done this twice now), I do a git fetch which identifies that there is a new branch, but when I do get checkout mybranch I get

fatal: reference is not a tree: mybranch

Additionally when I do git branch, the new branch is not actually listed.

Our bamboo server is also throwing the same error so we are unable to run the build.

If I use Source Tree the branch is downloaded properly but, it is no use as Bamboo doesn't use Source Tree.

I have seen other people on the internet having same error but none of the issues seem related to what I am experiencing.

Any ideas or clues on how to proceed?

2 answers

Hello. I met same problem.

Atlassian Bamboo version 7.2.2 build 70209 - 22 Jan 21

I run plan for custom revision. I got error in pipeline and when try to restart incomplete job, got same error. Create new pipeline for this revision? resolved this problem. Probably it's some bag.

0 votes
Ana Retamal Atlassian Team Jul 27, 2018

Hi Fernando, have you tried the command line?

You said that when you use Sourcetree it works, so I wonder if it's something related to Tortoise. 

Have you seen this Checkout failed reference is not a tree? Does that help you?

Let us know!


Hi Ana,

Yes I always use the command line git bash, I only use Sourcetree to look at code differences. That is were I found out that I could checkout the branch with sourcetree.

I did look at the link you sent but I couldn't find a relation to what is happening. Our webhooks have not changed and are not any of the ones listed on that link (if I am understanding that properly).

I got it to partially work now. I checked in a "dummy" change against master and now all new branches can be checked out normally using the command line. Having said this, for the two old branches that had issues I am still unable to check them out (so is bamboo). So to move forward I have decided to ignore those two branches. It is a pity thought that I don't know what the actual problem is.

Thanks for your response


Suggest an answer

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

Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022

Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...

2,229 views 2 9
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