When I am trying to upload my code to github. Below are the steps which I executed in the Git Bash terminal. When I try to push the code to github using $ git push -u origin main
the cursor moves to the next line and keeps blinking but does nothing.
git remote add origin "https://github.com/TarunRajinikanth/Trifacta.git"
git add -A
git config --global -user.name "username"
git config --global -user.email "useremail@gmail.com"
git commit -m "this is my first commit"
git branch -m main
git push -u origin main
Update Oct. 2021:
issue 384 describes again the problem:
During the host provider auto-detection when GCM makes a HTTP call to the remote, this can sometimes hang until a long timeout period has elapsed.
This now has been fixed with PR 481 "Speed up host provider auto-detection and make more robust" (see commit 1f926e4 )
Update July 2021:
Git for Windows 2.32.0(2) does include GCM (Git Credential Manager Core) v2.0.475.64295 , which should solve the issue/PR 374 ("Fix bug where GUI prompts would not be shown on Windows").
Original answer (June 2021):
Check your git config credential.helper
to see if a caching mechanism would be the issue.
You should:
%PATH%
(before opening a git bash), in order to reference C:\Program Files\Git\mingw64\libexec\git-core
,you do that with:
printf "host=github.com\nprotocol=https"|git-credential-manager get
If you see the wrong password, remove it with:
printf "host=github.com\nprotocol=https"|git-credential-manager erase
Repeat the erase
command until you see a popup (do not enter your credentials then)
Then repeat your git push -u origin main
, and enter your credentials to store them.
Note that git-for-windows/git issue 3268 points to microsoft/Git-Credential-Manager-Core
issue 364 .
As a temporary workaround:
git config --global credential.provider generic
Note that microsoft/Git-Credential-Manager-Core
v2.0.475 has just been released to fix issue 364 with PR 375 , in the context of Git 2.32 (May 2021).
The latest snapshot of Git for Windows should include that fix.
I too had the same problem, I managed to solve it after hours of work. Now I share with you how I managed it 🙂. I found three methods to solve this problem, I hope at least one of them works for you! But before I explain the solution that worked for me, I'll explain step by step what the problem is:
If everything worked (as it should), after running the command:
$ git push -u origin main
a new small window would appear for entering the GitHub username and password, this is because basically Git asks GitHub for permission to make changes. This "window" is the Credential Helper .
So the problem you're experiencing is due to an authentication issue .
$ git config remote.origin.url https://USERNAME:PASSWORD@github.com/USERNAME/REPONAME.git
$ ssh-keygen -t rsa -b 4096 -C "youremail@example.com"
I hope I have been of help to some of you. 🙂
Remember:
https://github.com/USERNAME/REPONAME.git
git@github.com:USERNAME/REPONAME.git
$ git remote add origin git@github.com:USERNAME/REPONAME.git
$ git config remote.origin.url git@github.com:USERNAME/REPONAME.git
$ git remote add WORD URL
Tried both the 1st and 2nd methods. Unsuccessful. However, after reinstalling, I restarted the computer and after starting, Git installed some restore/addition. After that, a pop-up window appeared - I passed the verification and everything worked out. After that, this letter came via e-mail:
A first-party GitHub OAuth application (Git Credential Manager) with gist, repo, and workflow scopes was recently authorized to access your account. Visit https://github.com/settings/connections/applications/0120e057bd645470c1ed for more information.
In the end, I achieved my goal. Then it should be easier.
我相信最新版本(2.32)有一个错误尝试将git降级到这个版本(2.30.x)这是下载git 2.30.2的链接
If you are using windows credential manager, use CMD instead of git bash . Then it gives you the alternative authentication methods to proceed.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.