2

I have a Git repo with a couple of branches that refuses to push to Github. It previously worked fine and other projects can be pushed.

Basically, in VSCODE after entering push the cursor just goes down to the next line and hangs there. Nothing happens and there is no error output at all.

I previously tried various suggestions including git config --global core.askpass "git-gui--askpass", which is included in the most upvoted answer on this SO question, but that outputs nothing either.

I thought it might be something funky in VSCODE, so I tried in a regular Terminal window. That also didn't work but returned this warning.

DEPRECATION WARNING: The system version of Tk is deprecated and may be removed in a future release.

This appears to be something Python related, but I am stumped on what to do with it.

If anyone can point me in the right direction to fixing this I'd much appreciate it.

mikeym
  • 5,705
  • 8
  • 42
  • 62
  • 1
    Git-gui is a tcl/tk app (i.e., is written in the tcl programming language, using the Tk bindings). If your system Tk is deprecated (apparently it is), that could cause this message when firing up git-gui. Note that while git-gui is distributed *with* Git, it's generally not well-maintained; the core Git team don't keep it up to date. What this boils down to is: you're probably better off using straight-off command-line Git, rather than Git-GUI. – torek Sep 13 '21 at 04:23
  • 1
    The actual next step for your system may be OS- and Git-version dependent, so aside from knowing the above about git-gui, editing your question to mention OS and Git version is probably a good idea. – torek Sep 13 '21 at 04:26
  • @torek Thanks for response. Just to clear up any possible confusion, I am using the command line for the Git push. That is, not a GUI. – mikeym Sep 13 '21 at 05:00
  • 1
    OK, but, `git-gui--askpass` is part of the git-gui suite. You probably want a credential helper for https. – torek Sep 13 '21 at 05:16
  • 1
    Do you access all your github repos (your question seems to imply you have several) though https ? Can you switch to an ssh access with an ssh key to authenticate ? – LeGEC Sep 13 '21 at 07:18
  • @LeGEC Thanks for the response. I posted an answer for it because there were a few steps involved in my case. The final step was using token-based authentication since apparently GH doesn't support password auth anymore. I needed to upgrade git to get to the password prompt, but everything worked after that. – mikeym Sep 13 '21 at 15:44
  • @torek thanks also for the comments. It really helped get to the steps that fixed it. I didn't even think that `git-gui --askpass` was supposed to launch a GUI. Sounds silly because it's written in the command, but in the answers I saw there was no mention of a GUI so it didn't occur to me and the command returned nothing. – mikeym Sep 13 '21 at 15:46

2 Answers2

1

So, based on the guidance given above, I managed to fix this issue on the mac with the following steps.

  1. Check the current Git version with git --version, for me it was git version 2.24.3 (Apple Git-128)
  2. Upgrade following the instructions of the most upvoted answer on this SO question. Note: if after running brew install git the git --versionstill shows the default Apple installed Git, you must..
  3. Run export PATH=/usr/local/bin:$PATH to make sure the system uses the latest version of Git which was just installed using brew.
  4. Check the git --version again. It should now show a higher version and NOT have Apple in the output as above. For example, mine was updated to git version 2.33.0.
  5. I then tried to push again but received remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead. As the message says, Github has recently switched from password auth to token-based so you need to generate a token in your GH account. It's pretty straight forward by following the Github Doc. If you already have a Personal Authentication Token...then..
  6. Copy the Personal Access Token and when prompted for a GH password following a git push, paste in your token and you should be good.

Hope those steps help anyone else facing the same issue. Thanks to the contributions above which helped greatly with finding this solution.

mikeym
  • 5,705
  • 8
  • 42
  • 62
0

For testing, try again with:

  • the latest Git (2.33.0.2)
  • the default shell (if you are on Windows, a new CMD session)
  • the right credential helper (again, on Windows, git config --global credential.helper should return manager-core)
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thanks for suggestion. I am upgrading Git right now. However, I'm on mac, is there an equivalent command for 'credential.helper' step? Thanks! – mikeym Sep 13 '21 at 14:56
  • 1
    @mikeym on Mac: `git config --global credential.helper` should return osxkeychain. But I would recommend installing GCM (https://github.com/microsoft/Git-Credential-Manager-Core#download-and-install) – VonC Sep 13 '21 at 15:03
  • Thanks again @VonC. I finally solved it. There were quite a few steps involved so I decided just to post an answer. That said, your input really helped move things forward! – mikeym Sep 13 '21 at 15:41