[Solved] error: src refspec predominant doesn’t match

0
9
Adv1


Adv2

If you first try to push to a git repository, you might get the next error message:

error: src refspec grasp doesn't match any.
error: didn't push some refs to '[email protected] ... .git'

It’s because you haven’t dedicated your information!

Tips on how to Repair src refspec predominant doesn't match

git commit -m "preliminary commit"
git push origin predominant

The above code will commit your information which are staged, earlier than pushing them to your required department.

By default, we push our code to the predominant department above. Swap this out with one other department in the event you want.

Tips on how to Present all References in Git

If you wish to first see the references in git, then you need to use the show-ref command:

git show-ref

# abc123d5d8d40586df855302eca139ee2b75f789 refs/heads/predominant
# abc123d5d8d40586df855302eca139ee2b75f789 refs/remotes/origin/predominant

As soon as you understand this, you possibly can push the code accordingly:

git push origin HEAD:<department>

You may additionally ask these questions

How do I repair error SRC Refspec grasp doesn’t match any?

First examine what git references:

git show-ref

How do I repair error SRC Refspec predominant doesn’t match any error didn’t push some refs to?

git commit -m "<your message>"
git push origin predominant

How do I push to predominant department GitHub?

git push -u origin predominant

How do I power git to push?

git push -u origin <department> -f
Adv3