1

git push origin main stuck forever not upload anything.

I have run following steps

        git init
        git add -A
        git commit -a -m "update"
        git branch -M main
        git remote add origin https://github.com/hoogw/j2t.git
        git push origin main

Eveything runs well, until last step, it stuck there forever, and not uploading anything.

enter image description here

enter image description here

hoogw
  • 4,982
  • 1
  • 37
  • 33
  • Run `git remote set-url origin git@github.com:hoogw/j2t.git` and then again `git push origin main` – SwissCodeMen Jan 01 '23 at 23:27
  • I agree. The mistake was saying `git remote add origin https:...`. Do _not_ use `https` to talk to GitHub via Git. – matt Jan 02 '23 at 01:08
  • It may be the issue that the credentials manager cannot be reached. May be something along these lines? https://stackoverflow.com/questions/16052602/how-to-disable-osxkeychain-as-credential-helper-in-git-config – jpe Jan 02 '23 at 08:41

2 Answers2

0

You can check if your git can actually access GitHub remote (in case the problem is network) by fetching the remote first

git fetch origin

If it can fetch without error, then you can push your commit with verbose flag to see if there is any issue while git push

git push --verbose origin main
Izzur Zuhri
  • 33
  • 1
  • 6
-1

git remote set-url origin git@github.com:hoogw/j2t.git

without use https:// does not work

enter image description here

I think it is because of github's bug or credential manager downtime, I did not do anything, after 1 week, github fixed their bug, I repeat the same steps as befor, it works without any issue. It must be github fixed their bugs(credential manager), I did not do anything. This question should be closed. Below is working steps.

enter image description here

hoogw
  • 4,982
  • 1
  • 37
  • 33
  • "This question should be closed." So close it. There is a Delete button under your questions. Click it! – matt Jan 08 '23 at 19:45