Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Git Branch not recognized on staging server

Vlad Vlad
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 17, 2020

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
German Mumma
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 17, 2020

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!

0 votes
Lenin Raj
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 17, 2020

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

Vlad Vlad
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 17, 2020

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.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events