Click here to Skip to main content
15,886,362 members
Articles / DevOps / Git
Tip/Trick

Git – Push from GUI Client Returns "Authentication Failed"

Rate me:
Please Sign up or sign in to vote.
5.00/5 (1 vote)
12 Aug 2022CPOL1 min read 4.3K   1  
Git push to GitHub or Bitbucket from 3rd party GUI client results in "Authentication Failed"
In this article, we are showing how to properly configure access of your 3rd party Git GUI client like SourceTree, GitHub Desktop, MeGit/EGit to remote repositories like GitHub and Bitbucket.

1. Problem

When using 3rd party Git GUI, you might have a problem setting authentication. Typically, that will manifest itself in this way: Git push to GitHub from 3rd party client results in "Authentication Failed". The situation can happen with Git clients SourceTree, GitHub Desktop, MeGit/EGit with remote repositories GitHub and Bitbucket (it does not necessarily happen in all combinations, but I have seen it in several).

1.1. Problem on MeGit

I will demo the problem with screens from MeGit, but it will happen with other Git GUI clients.

So, after you try to push, you get a message:

Image 1

Then you are prompted for the credentials:

Image 2

Then you enter your GitHub account name and password. But it does NOT work. You are again presented with the same message: “Not authorized”.

1.2. Problem in SourceTree

Here is how the same situation looks in SourceTree application:

Image 3

Then you enter your account name and password. But it does NOT work. You are again presented with the same message: “Not authorized”.

2. Solution

That is not the proper password you are entering here. It is not the GitHub account password they want here. You need to generate an “access token.”

2.1. Generating Access token on GitHub

Here are a couple of screens that will help you create a token at GitHub:

Image 4

Image 5

Image 6

Image 7

Image 8

Image 9

Once you get the Access token, enter it in as a password together with your GitHub account name to your 3rd party Git GUI.

2.1. Generating Access token on Bitbucket

The analogous process is on Bitbucket site. Here are a couple of screens to help you.

Image 10

Image 11

Again, once you get the Access token, enter it in as a password together with your Bitbucket account name to your 3rd party Git GUI.

History

  • 12th August, 2022: Initial version

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
Serbia Serbia
Mark Pelf is the pen name of just another Software Engineer from Belgrade, Serbia.
My Blog https://markpelf.com/

Comments and Discussions

 
-- There are no messages in this forum --