Read Latest Posts on Web Design and Development Click Here

How To Fix "Fatal: Authentication Failed" Error easily In Git

Fix "Fatal: Authentication Failed" error in git in few simple steps. Step 1: Go to homepage of GitHub. Step 2: Login to your GitHub account. Step 3...

Hello guys, welcome to my web development blog Webcrop. Today in this article i am going to show you step by step how to easily fix this "Fatal: Authentication Failed" error in git in very simple steps. 

This "Fatal: Authentication Failed" error usually occurs when you are trying to push your local repository to remote repository on GitHub via (CLI) Command Line Interface. Or when you have enabled (2FA) Two Factor Authentication on your GitHub account.

Most common cause of this error is when you execute "git push -u origin master" command in your terminal. What this command does is it basically links your remote repository to your local repository.

Now without wasting time let's dive in to solve this issue.

How to solve "Fatal: Authentication Failed" error in git, GitHub, version control.

Follow Below Steps carefully  solve this issue

Step 1: Go to GitHub official website's homepage.

Step 2: Login to your GitHub account.

Step 3: After successfully logging in, you will see your profile picture on the top right corner as shown in the image below. Click on your profile picture.

How to fix "Fatal: Authentication Failed" error in git.

Step 4: When you will click on your profile pic you will see a lot of options, one of the option will be "Settings", click on Settings option.

How to fix "Fatal: Authentication Failed" error in git.

Step 5: After clicking on settings option you will see a new page. On that page there will be a sidebar panel on left side with many options. One of the option will be "Developer Settings". Click on it.

How to fix "Fatal: Authentication Failed" error in git.

Step 6: After clicking Developer Settings option you will see another small sidebar panel on left side. There will be three options. One of them will be "Personal access tokens". Click on it.

How to fix "Fatal: Authentication Failed" error in git.

Step 7: After clicking Personal access tokens option, you will see a "Generate new token" button on top right of the corner. Click on it.


Step 8: After clicking the Generate new token button you will see many input fields as shown in image below.


How to fix "Fatal: Authentication Failed" error in git.


Now you have to fill them one by one. In the first name input field you can give any name you want.

How to fix "Fatal: Authentication Failed" error in git.


After filling out the name field click on Expiration input field. After clicking Expiration input fields you will see many options and you can choose any of them.

How to fix "Fatal: Authentication Failed" error in git.

But if you have chosen the "No Expiration" option then GitHub will give you a warning as shown in image below.

How to fix "Fatal: Authentication Failed" error in git.

There is no need to worry about the warning. You can clearly read that warning. So you can go on wih no Expiration option.


Related: Complete Beginner’s Guide to become a job ready full stack web developer.


After filling Expiration input field. Now you need to check out the checkboxes. You can select them according to your needs but i suggest you to select all of them if you are newbie to Git, GitHub and Version Control but if you know this stuff then you can select checkboxes according to your need. In the picture below i have also selected all the checkboxes.

How to fix "Fatal: Authentication Failed" error in git.

Step 9: After filling all the necessary input fields. You will see a green colored "Generate Token" button. Click on that button.

How to fix "Fatal: Authentication Failed" error in git.

Step 10: After clicking the Generate token button. You will see your token is generated in a green colored wide box as shown in image below. Now on the right side of access token you will see a copy icon. Click to copy the access token.

How to fix "Fatal: Authentication Failed" error in git.

Note that this token is only shown one time to you, so make sure to copy it and paste it in a text file and save that. So in future you will not face the same problem.

After copying the access token, now let's try to push a local repository to remote repository and see if this "Fatal: Authentication Failed" error is gone.

Step 11: Open the terminal and execute the following command "git push -u origin master" now it will ask uou for username write your GitHub username there and hit enter after hitting enter it will ask you for password now in the password you have to paste your personal access token which you generated previously.

Now this error "Fatal: Authentication Failed" should be gone. If not i am providing the below link to a Stack-overflow page where this issue is also discussed and answered.

Click Here To Visit Stack-overflow Page

Click here to read latest articles on web development

Post a Comment

Don't include links in your comment otherwise your comment will nit be published
© Webcrop . All rights reserved. Distributed by Infinity Blogger