Connecting Local Git Repository to GitHub does not work

I two courses I take this semester the code for the exercise part of these lectures is hosted in a GitHub repository. As I am required to work with the code, I need to interact with the remote Git server. When I try to pull by using git pull in command line as well as in the Eclipse IDE, a pop-up opens where I need to authenticate myself by providing username and password.
1 answer

After research I found out, that GitHub has updated their authentication policy, where it is no longer possible to use basic authentication. After research and talking to colleges, who participate in the same courses, I found that GitHub provides a service called Authentication Tokens. With using these authentication tokens, I was able to authenticate with the GitHub server in the Eclipse IDE, where I used the authentication token and inserted it into the password field. With that, I could use the git tools provided in the Eclipse IDE and interact with the remote repository. As the Git support in the Eclipse IDE, I searched for another solution. There I found that GitHub provides a Windows application called GitHub desktop, which automatically connects to GitHub when provided with the correct credentials. With that, I was able to fully interact with the remote repository, but I still had no command line options to execute git commands on. At last, I found the solution to my problem. The problem was, that the git client does not automatically check for updates. Therefore, I had an old git client, which was not able to communicate using the updated GitHub authentication. To finally fix this problem and being able to communicate with GitHub again, I needed to execute the command git update-git-for-windows. With that command, I was able to update my Git client and was now able to authenticate with the GitHub server using the new OAuth authentication method.

Comments

you can always use your SHA key to authenticate with github. Its the most convenient because it is independent of the program you are using to connect to github

Ondrej Brichta - Mon, 12/20/2021 - 11:52 :::

Thank you for that explanation! So far, I have only been aware of GitHub CLI, which is yet another client that is maintained by GitHub.

Stefan Puntigam - Tue, 12/21/2021 - 17:08 :::

Thanks for sharing this, this is very helpful specially for the users who had created accounts before the policy changes. Here's another demo for it: https://docs.github.com/en/authentication/keeping-your-account-and-data-...

And of course it is important that users check their token expiration date.

Parinaz Momeni ... - Wed, 12/22/2021 - 00:39 :::

When the basic authentication is not working any more you should swith to ssh authentication. I had similar issues during the migration from gitlab to github. But here you can find everything regarding ssh and github https://docs.github.com/en/authentication/connecting-to-github-with-ssh/...

Nino Ziegelwanger - Wed, 12/22/2021 - 11:18 :::