Question:
Why does git-bash hang when cloning a non-public repo when installed with defaults?
Context:
I ran into this issue when trying to clone a private GitHub repo on my co-workers Windows 10 machine.
Steps to reproduce:
Installed the newest version of git bash for Windows (for at the time of writing this post for me was 2.32.0.windows.1). Choosing all of the defaults.
Run git clone [http-link-to-private-repo]
Expected:
A popup to enter username and password information.
My Hack Solution:
When installing 2.32.0. for windows check the "Enable experimental support for pseudo consoles.".
This allows the bash console to present you an option to authenticate via a web browser or a personal access token.
Unrelated Note:
I originally was looking to post this on the Github Issues page for Git but they don't have one so here I am. Not sure if this is the appropriate place to post this but I wanted it somewhere so another person doesn't run into the same trouble.
Many thanks this was the solution after everything else failed including setting up a new installation, a new access token, and trying to find faulty config files.
After updating my personal access token this behavior also occurred with git 2.28.0.
So i did an update to the newest git version and afterwards the above mentioned steps.
(Sorry, i can not make any comments directly.)
I also ran into this problem setting up my dev environment for a new work laptop... Thankfully I had an older Windows GitBash installer (2.31.1) so I ended up downgrading to the older version. Worked like a charm, for me but understand it may not be an option for everyone.
On my Windows 10 machine I need to have two Git accounts and I have no idea how to setup it. I have read about setting different values at different projects but my problem is slightly different. So I use Git in my Visual (Git extension for VS 2017 ; and my boss authenticated once ater cloning repo with his acc) and in PyCharm (build in version control).
When I want to push changes from Pycharm to my public Github repo I am getting error saying that my boss account is denied permission. And after deleting it from Credential Manager, I can push, pull everything.
After switching to Visual and doing something Git related, there is a entry added to Credential Manager.
And I am in loop. I need both things to work.
And I am in loop
Only if both remote repositories (the working one, and the public one) are both on GitHub.
Then the credential helper "manager" would only record one credential (username/password) for "github.com".
An alternative would be to use an SSH URL instead of an HTTPs one.
Then you could easily distinguish the credentials to use for each repository, as I mentioned in "How to set up authentication for two separate GitHub accounts from same ssh client?".
I cloned a VSTS (NOT GitHub) repository with bash on windows using URL like https://myproj.visualstudio.com/repo and now I'd like to be able to use in-built VS2017 git window for my work, however when I do say Pull I get a window asking for my username/password and after I provide them I get this error:
Git failed with a fatal error.
could not read Username for 'https://myproj.visualstudio.com': terminal prompts disabled
which doesn't make any sense to me, I'm still able to do everything from git bash, I was also able to use VS2017 in-built window until today (we had some accounts migration which I'm not aware of the details), I tried relogging everywhere (at least what I'm aware of) and reinstalling git/visual studio, but still no success. All the suggestions I was able to find are either related to GitHub or suggest me to use ssh, which I don't want to, because my colleagues still have it working quite fine with https as before
A workaround for me was to download and install TortoiseGit and then get a repository cloned through its credential manager. Afterwards, I connected to the repository within Visual Studio 2017 as a local repository.
In this approach we have to use TortoiseGit for all repo operations.
Better to try these instructions, which completely resolved my issue:
https://www.danielcrabtree.com/blog/176/how-to-fix-fatal-error-with-git-in-visual-studio-2017
Turns out I had to delete contents of this file:
C:\Users\my_user\.ssh\known_hosts
I didn't see it documented anywhere, it was just one of my numerous random attempts to fix things
I have just set up my computer with a clean install. My project code etc was already on a secondary D drive so is unaffected.
I installed Git and TortoiseGit.
I now try to do a Push and get an error about a UriFormatException. Then it shows the password window:
I can log into my repositories OK on BitBucket web page. So what have I done wrong?
The whole point is that yesterday I was able to communicate these repositories with bitbucket.
Now I can't. ChuckieAJ is correct.
But something is wrong on my setup of TortoiseGit etc.
All I know is that I can no longer push anything to my bitbucket account. It is all messed up. :(
This helped me out:
https://help.cloudforge.com/hc/en-us/articles/215243143-Configure-TortoiseGIT-client-to-work-with-SSH-keys-on-Windows?mobile_site=true
I had to click on Git / Remote in each repository and correct the URL links to the new SSH locations and use the new Putty Key path.
Probably, ChuckieAJ should not be part of the url -- at least not with ChuckieAJ# in front of it but probably with bitbucket.org/ChuckieAJ/yourproject or something.
I've reinstalled, uninstalled, restarted but "Clone in Mac' on any repository page fails and takes me to the GitHub download page every time.
It was working fine earlier this week but today won't do anything useful.
Any idea why?
It appears not only do you have to log in to the website, you have to log in to the application once as well so it knows you've got it installed. Then refresh the git repo page and the links will automagically change from the download page to an open-application page.
I tried the above suggestions of making sure I was logged in to both the site and the Github-Mac application (which I already was) and installing the CLI tools. This didn't fix it for me. After some digging I found this article which explains how it works.
There should be a server listening on your localhost with https://ghconduit.com:25035/status and it should return a json string that looks something like this:
{"capabilities":["status","unique_id","url-parameter-filepath"],"running":true,"server_version":"5"}
In my case I did not get a result so I tried 127.0.0.1 instead of ghconduit.com and that fixed it.
TL;DR: Add an entry for 127.0.0.1 ghconduit.com to your /etc/hosts file and refresh the github page you are on and the clone on desktop function will work.
As was noted in the comments: You must be logged in to Github for the "Clone on Mac" button work.
(This answer serves mostly to remove this question from the "unanswered" list, since the asker does not seem to be closing it)
Even doing all the above failed for me, but here's what did work:
Open a new tab.
Paste this in the address bar (without quotes):
"github-mac://openRepo/"
On the repo you want to clone, copy the HTTPS clone URL, and paste it after the link above. Press enter.
If the server is listening on your Mac #rjason-lindberg mentioned, then it should open up in GutHub for Mac.
I just had this problem, and I found two steps necessary to get it working: the "log in" answer above, and to open GitHub.app, got to Preferences > Advanced > Install Command Line Tools.
This took no time. I then refreshed the github page, and saw that the link now led to something like: "github-mac://openRepo/https://github.com/......"
Click it and it worked.
I have answered my own question: the trick is TO BE LOGGED IN on the GitHub website. As stated by Neil above, you need to be logged into the application too.
I just tried this and it seemed to work.
Go to Keychain Access and delete all stored passwords (Internet,
application, Web form) with reference to GitHub.
Login in fresh on to the site as well as from the Mac OS desktop application
Store the passwords this time
None of the other answers did the trick for me. But seeing that neither https://ghconduit.com:25035/status nor https://localhost:25035/status was able to connect I realized that the Conduit process wasn't running. It's in "GitHub.app/Contents/Library/LoginItems/GitHub Conduit"
open that, and clone to desktop finally works again.
Don't know why GitHub.app didn't start it by itself, but at least it works now.
edit: After each reboot the GitHub Conduit process needs to be manually started again.
None of the other answers worked for me. I tried logging out (both GitHub and GitHub for Mac), revoking the application access key, quitting the application, reinstalling the GitHub command-line tools (via the Preferences pane), etc.
What did work for me:
Clone (Edit: I think I might have meant "Fork"?*) the repository on github.com. (Yes, through the web interface)
In the GitHub for Mac application, access File > New Repository... and choose "Clone". Select the repo you just created on github.com and clone on, my friend! Clone on.
*It has been a while since I wrote this answer, so I'm not sure if I actually did mean "Clone"... I understand that forking and cloning are certainly not the same thing. I'll leave this answer here in case it happens to inspire a thought for someone!