error: src refspec development does not match any when doing a push

3

When I try to push the development branch of my repository I get the error

  

error: src refspec development does not match any.

This is what I have done:

1 - cloned the repository

git clone [email protected]:solay-Apache/koica-inscriptions.git

2 - I created a new branch and I positioned myself in that branch:

git branch db
git checkout db

3 - I did a pull of the development branch of the remote repository

git pull origin development

4 - I made changes to the project code and made a commit

git add .
git commit -m "mensaje"

5 - I push the development branch of the remote repository

git push origin development

6 - when doing the push I get the error

error: src refspec development does not match any.
error: fallo el push de algunas referencias

Additional information:

$ git show-ref
refs/heads/db
refs/heads/master
refs/remotes/origin/HEAD
refs/remotes/origin/development
refs/remotes/origin/master

$ git remote -v
origin  [email protected]:solay-Apache/koica-inscriptions.git (fetch)
origin  [email protected]:solay-Apache/koica-inscriptions.git (push)
    
asked by Roman González 30.03.2018 в 22:53
source

1 answer

1

I was doing the same steps as samples and in fact the same error comes out.

What I can understand is that since you are not doing push to the same branch db, and you are doing it to another branch, this branch does not exist in your local, it does not find development.

therefore, you should use the name in the remote: refs / remotes / origin / development

So I solved it:

git push origin refs/remotes/origin/development

Now, that is a solution to your question.

The other thing you could do is:

  • Upload the db branch and make a Merge Request to the development branch.
  • Create the development branch in your local and upload it from that branch.

    git branch refs / remotes / origin / development

    git checkout -b development

    // Making the changes

    git add.

    git commit -m "message"

    git push origin development

answered by 08.04.2018 в 20:51