I can push just fine to my GitHub repo from my VPS, but once I enter a screen, I get permission denied:
littke@[server]:~/src/[repo]$ git push
Pushing to [email protected]:littke/[repo].git
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
Even though I'm able to auth:
littke@[server}:~/src/[repo]$ ssh [email protected] -i ~/.ssh/littke
Enter passphrase for key '/home/littke/.ssh/littke':
PTY allocation request failed on channel 0
Hi littke! You've successfully authenticated, but GitHub does not provide shell access.
Again, this only happens when inside a GNU Screen. I can push fine outside of it. I've googled but unable to find anything.
If git push origin master not working , all you need to do is edit that file with your favourite editor and change the URL = setting to your new location. Assuming the new repository is correctly set up and you have your URL right, you'll easily be able to push and pull to and from your new remote location.
The Git push command uploads local changes to your remote repository. Generally, when using Git, your code exists in both a local repository on your computer, as well as one or more repositories on a server.
Whenever we need to push the changes to a remote repository, we use git push along with the remote repository “origin” and “master” branches. The term used is “git push origin master“. To pull the changes from the remote repository to local, we use git pull along with remote repository “origin” and “master” branch.
The git push command is used to upload local repository content to a remote repository. Pushing is how you transfer commits from your local repository to a remote repo. It's the counterpart to git fetch , but whereas fetching imports commits to local branches, pushing exports commits to remote branches.
You're using a different identity file with ssh (the -i option) than git uses. You must tell git which identity to use, through your config. See github's Troubleshooting SSH issues, section "SSH config":
Create or open the file at ~/.ssh/config Add the following lines:
Host github.com User git Hostname github.com PreferredAuthentications publickey IdentityFile [local path]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With