Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Can not Push on Github through Ubuntu Terminal

I am trying to push to github from my Ubuntu machine.
I am able to Push from Visual Studio Code terminal, but can not Push from Ubuntu Terminal or Android Studio Terminal.
Every time I try to Push from Terminal or android studio terminal, it asks for username and password.
Even though I enter my valid username and password it says

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/mdshadatrahman/advanced_flutter.git/’

I have added ssh key using ssh-keygen -t rsa -b 4096 -C "myemailaddress"

But I can push form VS Code Terminal without any problem.

How can I solve this problem?
Thanks

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Almost forgot to add – I am able to Push using Android Studio shortcut(CRTL + SHIFT + K).

>Solution :

Looks like the remote uses the HTTPS protocol (password based) instead of SSH (key based).

$ git remote -l

should list your remotes, e. g.

origin  https://github.com:darmiel/eeee (fetch)
origin  https://github.com:darmiel/eeee (push)

If your origin remote starts with https:// you’re on the wrong protocol.
Change the HTTPS remote to SSH using git remote set-url:

$ git remote set-url origin git@github.com:darmiel/eeee.git

you can see the SSH url by clicking on the "Clone" button on GitHub:
enter image description here

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading