My Journey to the cloud…

In pursuit of excellence….


“git push” keeps asking password [Deprecating password authentication]

Today morning while pushing the changes to the github repository, I was constantly asked to provide the username and password at the console.

Despite passing the correct username and password, I was not able to push the changes and rather message below

It was working fine till yesterday night and hence was wondering what could have caused the issue. I started looking into the access token in the Github and saw that the one I was using till last night was expired and hence seeing the issue.

Password-based authentication for Git is deprecated (as evident from the screenshot above as well) and you should make the push based on the token authentication. GitHub has personal access token (PAT), to use in place of a password with the command line or with the API. Below is how to generate the token and use it.

Create a token in Github

  • Login to GitHub and navigate to ‘Settings’ from within your profile
  • Click on Developer Settings. This will take you to GitHub Apps page. Navigate to “Personal access token” section.
  • Click on Personal Access Token –> Token (classic).
  • You will find all your tokens (active or expired). Here I found my token to be expired today and hence I was able to run the”git push” command successfully till last night.
  • Click on ‘Generate new token’
  • Make sure you note down the ‘Personal Access token’. It won’t be shown again and if you didn’t note it down, there is no way but to create a new one.
  • Use the newly created token to use the ‘git push’ command.
    • $ git push https://<Personal-Access-Token>@github.com/<Your-Github-UserName>/<Name-of-your-repository>

Hope this helps. Happy reading.

~Anand M

Advertisement


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

About Me

I’m a Hands-On Technical & Entrprise Solutions Architect based out of Houston, TX. I have been working on Oracle ERP, Oracle Database and Cloud technologies for over 20 years and still going strong for learning new things.

You can connect me on Linkedin and also reach out to me

I am certified for 8x AWS, OCP (Oracle Certified Professionals), PMP, ITTL and 6 Sigma.

Disclaimer

This is a personal blog. Any views or opinions represented in this blog are personal and belong solely to the blog owner and do not represent those of people, institutions or organizations that the owner may or may not be associated with in professional or personal capacity, unless explicitly stated.
All content provided on this blog is for informational purposes only. The owner of this blog makes no representations as to the accuracy or completeness of any information on this site or found by following any link on this site.

The owner will not be liable for any errors or omissions in this information nor for the availability of this information. The owner will not be liable for any losses, injuries, or damages from the display or use of this information. Any script available on the blog post MUST be tested before they are run against Production environment.

Newsletter

%d bloggers like this: