0

I am currently learning how to use the git and github environment, but at the time of executing the code git push origin main and give enter, the console does nothing and does not allow me to execute more code.

The codes that I executed were:

git init
git add .
git commit -m "first commit"
git status

git remote add origin https://github.com/USER_NAME/PROJECT_NAME.git
git pull origin main
git push -u origin master

In this order, respectively.
I hope you can help me.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • 2
    Is it `git push origin main` or `git push -u origin master`? And are there any errors? – Brian Destura Jul 21 '21 at 02:14
  • I had the same problem. I have written the solution here: [Click here](https://stackoverflow.com/questions/68057254/after-git-push-u-origin-main-command-git-bash-is-not-requesting-any-authentic/68257872#68257872) – Giuseppe Amato Jul 25 '21 at 08:59

1 Answers1

1

It depends on your OS and your git config credential.helper value: Git might try and access a credential helper (to cache your GitHub credentials) but fails.

That would explain why a git push (preferably using main: git push -u origin main) hangs.

If you are on Windows, make sure to have the latest Git For Windows (2.32.0.2), as there was a bug with Git 2.32.0.1.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250