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

Git Branch not recognized on staging server

I have created a git branch from master at a certain commit that is a bit behind. I made some updates and tried to push to that specific branch.

Steps I did:


  • git clone [url]
  • git checkout -b [new-branch] [commit-hash]
  • git add .  / . git commit -m "message"  /  git push origin [new-branch]

After push I get the following error:


remote: Create pull request for [new-branch]:

remote:   http://stash......[url]



When I try to checkout to my new branch of the staging server I get:

fatal: ambiguous argument 'origin/[new-branch]': unknown revision or path not in the working tree.

I don't know how to proceed further.

2 answers

0 votes

What do you mean by "staging server"? Is it a different server from the one you pushed to in the previous step?

Yes it is a different server. I think my branch is only local or something.


I also tried to create a new branch from a JIRA task, as a hotfix, and there it detected by [new-branch]. And i created a new branch hotfix/[newer-branch] from the [new-branch], directly from the platform.

This doesn't work either, still doesn't see my branch.

Hi, Vlad


Check what is the output of following command.

  • check what is the status of your branch you are on with
git status

Next I would check if the remote is set up correctly:

git remote -v

Then see how the branch you are looking for is displayed (if it is, that is):

git branch -a 

If you see no remote branches pointing to origin/master then execute following command:

git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/master

 This should set refs/remotes/origin/HEAD to point to the origin/master branch.


Hope this helps!

Suggest an answer

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

Contest: Share your custom Bitbucket Pipe and win

Announced in this blog, this holiday season we’re celebrating all things CI/CD and between now and the end of 2019 we’ll be showcasing content, use cases, feature announcements and more. One featur...

1,040 views 4 4
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