What to do about “PTY allocation request failed on channel 0”

前端 未结 1 1902
甜味超标
甜味超标 2020-12-12 21:48

I can\'t see to wrap my head creating an ssh key for GitHub. I had it working quite awhile back but I can\'t figure out what has changed. I\'ve since removed the previous SS

相关标签:
1条回答
  • 2020-12-12 22:52

    As described in the comments on the question, the “PTY allocation request failed” is a red herring with respect to GitHub authentication (it is the result of trying to interactively login to GitHub when the only SSH service they offer is non-interactive Git-over-SSH; the authentication is working, they just do not provide interactive, “shell” service).


    The person who asked the question wrote this in a comment:

    I guess the related problem is that when I try to create a new repository and "git push origin master" I return the following "Error: Permission to myemail@address.com/myapp denied to myusername. Fatal: the remote end hung up unexpectedly"

    This seems more likely to be the actual problem. This seems to indicate that the remote named origin not configured to correctly point to a GitHub repository.

    Check the output of git remote show -n origin. Probably the “Fetch URL” and the “Push URL” are the same. They should both look like this:

    git@github.com:git-user-name/repository-name
    

    When logging into GitHub on the web you can use either your account’s username or its associated email address. When pushing to repositories (or fetching from private repositories) you have to use your actual username (an email address will not work). It looks you are using your email address in there instead of just your GitHub username. To fix this, reconfigure the remote’s URL:

    git remote set-url origin git@github.com:github-username/repository-name
    

    Your username is displayed in many places on the GitHub web pages once you are logged in. The easiest place to find it is between your gravatar and the “Dashboard” link on the page header (you will see a silhouette icon if you do not have a gravatar configured). That same location links to your public profile page; this page’s URL should also end in your username.

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