Using Personal Access Tokens on GitHub
When I attempted to push to one of my repositories on GitHub, I encountered the error message, “Support for password authentication was removed. Please use a personal access token instead.” After researching the issue, I discovered that GitHub no longer supports password authentication and only supports personal access tokens.
How do you use a personal access token? I found the steps on Stack Overflow (link provided below).
- Go to your GitHub account page and select:
- Settings
- Developer Settings
- Personal Access Token
- Generate New Token (then enter your password)
- Check the boxes for the permissions you want on the form displayed on that page.
- Click Generate Token and copy the token. It will look something like this:
ghp_sFhFsSHhTzMDreGRLjkdhbtzuzgthdvfsrta. Note that this token is only displayed once, so make sure to save it.
- Next, open your repository directory and type:
git remote set-url origin https://token@github.com/username/repo.gitwhere
tokenis your personal access token,usernameis your GitHub username, andrepois the name of your repository. - Done. You can now push your repository to GitHub without password authentication.
Source: Stack Overflow
Enjoy Reading This Article?
Here are some more articles you might like to read next: