Home > Mobile >  Git push for specific repo hangs
Git push for specific repo hangs

Time:09-16

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.

CodePudding user response:

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.

CodePudding user response:

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)
  • Related