Software Engineering

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

[Solved] error: src refspec fundamental doesn’t match
Written by admin


While you first attempt to push to a git repository, you could get the next error message:

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

It is because you haven’t dedicated your recordsdata!

Learn how to Repair src refspec fundamental doesn't match

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

The above code will commit your recordsdata which might be staged, earlier than pushing them to your required department.

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

Learn 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/fundamental
# abc123d5d8d40586df855302eca139ee2b75f789 refs/remotes/origin/fundamental

As soon as this, you’ll be able to push the code accordingly:

git push origin HEAD:<department>

You might also ask these questions

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

First verify what git references:

git show-ref

How do I repair error SRC Refspec fundamental doesn’t match any error did not push some refs to?

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

How do I push to fundamental department GitHub?

git push -u origin fundamental

How do I power git to push?

git push -u origin <department> -f

About the author

admin

Leave a Comment