3

I am using Visual Studio 16.7 and pushing code with Team Explorer. I am not using CLI. This project has been assigned to a GIT repository that I setup months ago. For months, I have pushed code to it with no problems.

All of the sudden I am getting prompted for login when I click "Push" in TFS. After I try to login, it comes back with the error "Failed to push to the remote repository. See the Output window for more details." But the output window says nothing more than:

Time Elapsed: 00:00:00.2689158 ========== Finished ==========

By the way, I cannot fetch or pull either.

I have gone over all the settings on the GIT website and I cannot find anything restricting my access and I am the owner of the repo.

I can't tell if GIT is refusing my login or if it is reaching he repo and there is some other issue that it is not reporting back to me. I do not seem to find an event log anywhere.

I am able to login to the GIT portal (on the Web) just fine.

Of note, Windows Update updated my PC about a month ago to a new version of windows. It caused a lot of problems as all my Windows settings were no longer there. But I fixed that and I got them all back. Not sure if there is something windows related that is stopping a connection through TFS.

enter image description here

HockeyDev
  • 81
  • 1
  • 6
  • May you attempt to push using the command line as that may have a better output? – evolutionxbox Mar 09 '21 at 18:07
  • No because I do not have GitBash and don't really now how to use it but I might have to. – HockeyDev Mar 09 '21 at 20:25
  • How did you install git? – evolutionxbox Mar 09 '21 at 20:25
  • I must have downloaded GIT from GitHub (or GitBash) because I notice that I do, in fact, have GitBash on my pc. I did not know I had it. It was a whil ago so I don't remember all of it because I was able to get Visual Studio working with the GitHub repo quite easily. – HockeyDev Mar 09 '21 at 20:29
  • So now (at this moment) I am trying to figure out a command to run that just tests the username/password – HockeyDev Mar 09 '21 at 20:29
  • "downloaded GIT from GitHub" probably not. Git comes from https://git-scm.com/, github is an unrelated company which uses git. – evolutionxbox Mar 09 '21 at 20:31
  • Thanks for the clarification and your help. Obviously, I have limited experience with all this stuff because I am using it through VS and GitHub. – HockeyDev Mar 09 '21 at 20:33
  • I think that using git-bash is probably going to help you out the most at the moment. When you get a chance, run `git push` from the root folder and add the output to the question – evolutionxbox Mar 09 '21 at 21:41
  • 2
    Hey Evolution. You are the champ! You were right. It did help. When I ran git push, it the CLI window came back and said "Logon failed, use ctrl+c to cancel basic credential prompt.". And then a new window opened that said "SSH Credentials" (or similar) at the top. It asked me to enter my GIT user/password. When I did, it pushed! I then got an email from GIT and how they are depreciating Basic Authentication and it will soo no longer work. There is a link in the email https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ Thanks a million! – HockeyDev Mar 10 '21 at 00:54

1 Answers1

1

Based on your description and related link in comment, it seems that you are pushing the Git repo to the Github.

You could refer to this blog:

As mentioned in this previous blog post, GitHub no longer supports basic authentication using a username and password. Instead, we recommend using personal access tokens or the web application flow.

The method to connect to Github has changed.

To solve this issue, you could try the following script to upload the Git version to latest.

git update-git-for-windows

Then you will see the Web application login interface when you push the changes. Or you could use Access token or SSH key as auth method.

Here is a ticket with the similar issue, you could refer to it.

Kevin Lu-MSFT
  • 20,786
  • 3
  • 19
  • 28
  • I was experiencing this same issue fetching/pushing with Azure DevOps and VS 2022. I could still fetch and push from the commandline, but VS wasn't happy. "git update-git-for-windows" fixed the problem. Thx! – tmgirvin Dec 07 '21 at 19:43