Forums

Problem with git push

I am trying to push locally to pythonanywhere, but I can't get it to work.

I followed this blog post and reached the point of "Checking it worked" without it working.

After this: git remote add python username@ssh.pythonanywhere.com:/home/username/bare-repos/mysite.git

I tried to do git push -u python main and I got an error remote: fatal: You are on a branch yet to be born

After that I did git push -u python main and there were no errors.

This is the output:

Everything up-to-date
Branch 'main' set up to track remote branch 'main' from 'python'.

I don't know how to fix that and why it's not throwing an error anymore. Any help?

That just looks like you do not have any local changes that need to be pushed. If you have not made any local commits, then there will be nothing to push.

I made a change and I did git push to push to GitHub but it asked me for my pythonanywhere password and after I input it, I got the same error. Then I did git push origin main and that worked and then git push python gave me Everything up-to-date, but there are still no files in /var/www/sites

Oh writing git push python HEAD:master worked

Great! Glad you found a fix.

Hi glenn, Please help me to resolve this issue: i have added ssh key but still can't use git to push my changes.

remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead. remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information. fatal: Authentication failed for 'https://github.com/pransukh/OLR-FINAL.git/'

See the help page provided by github about how to set up an access token and use it.

i'm still getting a permission error when using a github personal access token. i tried both the fine grain and classic varieties. I have also added a pythonanywhere sshkey to github.

error:

remote: Permission to tedphillips22/weathergame.git denied to tedphillips22. fatal: unable to access 'https://github.com/tedphillips22/weathergame.git/': The requested URL returned error: 403

I'm afraid we can't help with github authentication issues. You will need to use github's documentation or perhaps contact their support.