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

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:

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

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

remote:

 

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
TAGS
Community showcase
Published in Bitbucket

Powering DevOps with Bitbucket Server & Data Center

Hi everyone, The Cloud team recently announced 12 new DevOps features that help developers ship better code, faster   ! While we’re all excited about the new improvements to Bitbucket ...

2,119 views 0 7
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