Git Bash - Push Error

I am trying to push some files to my git repo using git bash. I keep getting the same error message but I dont understand what it means. This is what I’m putting thru and the error message I keep getting.
User@DESKTOP-5JDST6J MINGW64 /c/Users/user/Documents/git/Survey_Form (main) $ git push orgin master github.com/BetinaEchols/Survey_Form.git error: src refspec master does not match any error: src refspec github.com/BetinaEchols/Survey_Form.git does not match any error: failed to push some refs to 'orgin'

What is refs and refspec?

You don’t have a master branch. Github recently renamed the default branch to main (as you can see on your terminal prompt inside the parentheses).

The command

$ git push origin main

is likely what you want.

2 Likes

I tried what you said and got the same error message.

User@DESKTOP-5JDST6J MINGW64 /c/Users/user/Documents/git/Survey_Form (main) $ git push origin main github.com/BetinaEchols/Survey_Form.git error: src refspec github.com/BetinaEchols/Survey_Form.git does not match any error: failed to push some refs to 'https://github.com/BetinaEchols/Survey_Form.git'

Hmm, what are you outputs of the following-

git branch -a
git log
git remote -v

Edit: Web search suggests some folks get this error if they have made no commits at this point. I can replicate an almost identical error code by trying to push to a brand-new empty repo when no commits have been made. Double check you’ve actually made a commit at this point, just in case.

You can look up some details of “refs” and “refspec” in the docs- Git - git-push Documentation

1 Like

I will do as you suggest. Just so you know, I have made 4 commits on my local branch, but have been trying to push them to the Git Hub repo where no commits have been made. I will read the Git documentation on push and let you know what happens.

`User@DESKTOP-5JDST6J MINGW64 /c/Users/user/Documents/git/Survey_Form (main)
$ git branch -a

  • main
    remotes/origin/HEAD → origin/main
    remotes/origin/main

User@DESKTOP-5JDST6J MINGW64 /c/Users/user/Documents/git/Survey_Form (main)
$ git log
commit 6b494b5fb3c1d18e7099b41ea1ccc85d7641a138 (HEAD → main)
Author: @4uSwan betinaechols@att.net
Date: Fri Feb 19 19:03:42 2021 -0500

added new image file

commit d8f68a0ebc78e0695b1b18bb5614236425553f7e
Author: @4uSwan betinaechols@att.net
Date: Fri Feb 19 18:33:56 2021 -0500

change location of image file

commit ecb70bf6bddd95d19a3f50b52317c4eb14857053
Author: @4uSwan betinaechols@att.net
Date: Fri Feb 19 16:51:59 2021 -0500

changed image name

commit d1ef8ea50bf7da89067c064f2f3037c5bf316dd6
Author: @4uSwan betinaechols@att.net
Date: Fri Feb 19 15:38:45 2021 -0500

adding code files for form

commit 5133d9ef123528231522e9d5141aa73b30c308e6 (origin/main, origin/HEAD)
Author: Betina Echols 71508213+BetinaEchols@users.noreply.github.com
Date: Fri Feb 19 08:32:58 2021 -0500
`

This is the error message I’m getting now. Could it be that something is not set up right. I created the repo on Github and clone it to my computer. I had no problem them. Just when I tried to commit changes.
`
User@DESKTOP-5JDST6J MINGW64 ~/Documents/git/Survey_Form (main)
$ git push -u orgin main
fatal: ‘orgin’ does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
`

Hi,

You’ve misspelled origin as orgin.