Unable to Git-push master to Github - 'origin' does not appear to be a git repository / permission denied

前端 未结 9 1079
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-22 15:21

This question is related to my problem in understanding rebase, branch and merge, and to the problem

How can you commit to your github account as you

相关标签:
9条回答
  • 2020-11-22 15:33

    I think that's another case of git error messages being misleading. Usually when I've seen that error it's due to ssh problems. Did you add your public ssh key to your github account?

    Edit: Also, the xinet.d forum post is referring to running the git-daemon as a service so that people could pull from your system. It's not necessary to run git-daemon to push to github.

    0 讨论(0)
  • 2020-11-22 15:33

    I had this problem and tried various solutions to solve it including many of those listed above (config file, debug ssh etc). In the end, I resolved it by including the -u switch in the git push, per the github instructions when creating a new repository onsite - Github new Repository

    0 讨论(0)
  • 2020-11-22 15:37

    I have the same problem and i think the firewall is blocking the git protocol. So in the end I have to resort to using https:// to fetch and push. However this will always prompt the user to enter the password...

    here is the example what working for me (just to share with those cant use git:// protocol :)

    git fetch https://[user-name]@github.com/[user-name]/[project].git
    

    if the above works, you can remove the origin and replace with

    git remote rm origin  
    git remote add origin https://[user-name]@github.com/[user-name]/[project].git
    
    0 讨论(0)
  • 2020-11-22 15:39

    This is a problem with your remote. When you do git push origin master, origin is the remote and master is the branch you're pushing.

    When you do this:

    git remote
    

    I bet the list does not include origin. To re-add the origin remote:

    git remote add origin git@github.com:your_github_username/your_github_app.git
    

    Or, if it exists but is formatted incorrectly:

    git remote rm origin
    git remote add origin git@github.com:your_github_username/your_github_app.git
    
    0 讨论(0)
  • 2020-11-22 15:42

    I got the same problem and I just added the content of ~/.ssh/id_rsa.pub to my account in GitHub. After that just try again git push origin master, it should work.

    0 讨论(0)
  • 2020-11-22 15:50

    They key thing to remember is 'origin' is not the value you may need to be using... it worked for me when I replaced 'origin' with repo's name.

    0 讨论(0)
提交回复
热议问题