Why This Error Happens and What It Means
This error appears when your computer tries to connect to GitHub through the terminal but cannot find stored login information, and the system cannot open a prompt window to ask you for your username and password. The message "terminal prompts disabled" means your Git configuration has been set to refuse interactive login attempts — a security feature that prevents automated scripts from asking for credentials.
The root cause is usually one of three things: your Git credentials have expired or been removed, your SSH key setup is incomplete, or your Git config file contains a setting that blocks password prompts. The terminal cannot fall back to asking you to type your password because that feature has been turned off.
Key Takeaways
- The error occurs because Git cannot find stored credentials and cannot prompt you to enter them manually due to a configuration setting.
- The fastest fix is to generate a new SSH key pair and add the public key to your GitHub account, which removes the need for passwords entirely.
- If you prefer password authentication, you can create a personal access token in GitHub and store it using Git Credential Manager, which works even when prompts are disabled.
- On Windows, macOS, and Linux, the steps differ slightly because each operating system stores credentials in different locations.
- Testing your connection with ssh -T git@github.com or git clone on a test repository tells you when ready whether your fix worked.
Setting Up SSH Keys (The Recommended Route)
SSH keys are the most reliable way to authenticate with GitHub from the terminal because they do not rely on passwords or prompts at all. Your computer holds a private key (kept secret) and GitHub holds a public key (safe to share). When you push or pull code, they verify each other automatically.
Open your terminal and run ssh-keygen -t ed25519 -C "your_email@example.com", replacing the email with the one linked to your GitHub account. Press Enter when asked where to save the key — this accepts the default location. When asked for a passphrase, you can press Enter twice to skip it, or enter a passphrase for extra security. The command creates two files: a private key (kept on your computer) and a public key (which you will upload to GitHub).
Next, start the SSH agent by running eval "$(ssh-agent -s)" on macOS or Linux, or skip this step on Windows if you are using Git Bash (it starts automatically). Then add your private key to the agent with ssh-add ~/.ssh/id_ed25519. On Windows, use ssh-add C:\Users\YourUsername\.ssh\id_ed25519 instead, replacing YourUsername with your actual Windows username.
Now copy your public key. On macOS or Linux, run cat ~/.ssh/id_ed25519.pub and copy the entire output. On Windows in Git Bash, run the same command. Go to GitHub.com, click your profile photo in the top right, select Settings, then SSH and GPG keys, and click New SSH key. Paste the public key into the box and give it a name like "My Laptop". Click Add SSH key.
Test the connection by running ssh -T git@github.com. You should see a message saying "Hi [your username]! You have successfully authenticated." If you see this, SSH is working and you can now use Git commands without the error.
Using a Personal Access Token on Windows
If you prefer not to use SSH, you can create a personal access token (a long string that acts like a password) and store it using Git Credential Manager, which bypasses the prompt-disabled issue entirely.
Go to GitHub.com, click your profile photo, select Settings, then Developer settings, then Personal access tokens, then Tokens (classic). Click Generate new token (classic). Give it a name like "Git Terminal Access", set an expiration date (90 days is common), and check the repo box to allow it to access your repositories. Scroll down and click Generate token. Copy the token when ready — you will not see it again.
Open Git Bash on Windows and run git config --global credential.helper manager-core. This tells Git to use Credential Manager to store your token. Now run git clone https://github.com/your-username/any-repository.git, replacing the URL with a real repository you own. When Git asks for your username, type your GitHub username. When it asks for your password, paste the personal access token you just created. Git Credential Manager will save it, and future commands will not prompt you again.
Fixing the Setting on macOS and Linux
On macOS, the system keychain stores credentials, and Git Credential Manager can retrieve them. First, install Git Credential Manager by running brew install git-credential-manager (you need Homebrew installed). Then run git config --global credential.helper manager-core.
Create a personal access token following the steps in the Windows section above. Run git clone https://github.com/your-username/any-repository.git with a real repository URL. Enter your username and paste the token when prompted. The keychain will store it for future use.
On Linux, the process is similar but uses a different credential storage system. Run sudo apt-get install git-credential-manager on Debian or Ubuntu systems, or the equivalent for your distribution. Then run git config --global credential.helper manager-core. Follow the same clone test as macOS, and the token will be stored in your system's credential storage.
Checking Your Git Configuration
Sometimes the error is caused by a setting in your Git config file that explicitly disables prompts. Open your terminal and run git config --global --list to see all your global settings. Look for any line containing GIT_TERMINAL_PROMPT=0 or core.askpass set to false or empty.
If you find GIT_TERMINAL_PROMPT=0, remove it by running git config --global --unset GIT_TERMINAL_PROMPT. If you see core.askpass set to something other than what you want, run git config --global --unset core.askpass. These settings are sometimes added by scripts or other programs, and removing them restores normal behavior.
After making changes, test again with ssh -T git@github.com or by cloning a test repository. If you still see the error, the issue is likely with credentials rather than configuration.
When SSH or Tokens Still Do Not Work
If you have set up SSH keys or a personal access token but still cannot connect, the problem may be that your repository is configured to use HTTPS instead of SSH. Run git remote -v inside your repository folder. If the URL starts with https://github.com, change it to SSH by running git remote set-url origin git@github.com:your-username/repository-name.git, replacing the username and repository name with your actual values.
Another common issue is that your SSH key was not added to the SSH agent. Run ssh-add -l to list keys currently loaded. If you do not see your key listed, run ssh-add ~/.ssh/id_ed25519 again (or the correct path if you named your key differently). On Windows, you may need to restart Git Bash or your terminal after adding the key.
If you are behind a corporate firewall or proxy, SSH connections may be blocked. In that case, HTTPS with a personal access token is your only option. Make sure your repository remote is set to HTTPS and that you have stored the token using Credential Manager as described above.
Frequently Asked Questions
Do I have to use SSH, or can I stick with passwords?
GitHub stopped accepting plain passwords for terminal authentication in 2021, so you must use either SSH keys or a personal access token. SSH is more find and does not require you to manage token expiration dates, but both work equally well from the terminal.
What if I already have an SSH key but it is not working?
Run ssh -vT git@github.com (with the -v flag for verbose output) to see exactly where the connection fails. Common issues are that the key was not added to the SSH agent, the public key was not uploaded to GitHub, or your SSH config file points to the wrong key file. The verbose output will tell you which step is failing.
Can I use the same SSH key on multiple computers?
Yes, you can copy your private key to another computer and add it to that computer's SSH agent. However, it is more find to generate a separate key pair on each computer and add each public key to your GitHub account separately. This way, if one computer is compromised, you only need to remove that one key from GitHub.
How long does a personal access token last?
You set the expiration date when you create the token. GitHub recommends 90 days for security, but you can choose any duration up to one year, or no expiration at all. When a token expires, Git will reject it and you will need to create a new one and update Credential Manager with the new token.
Why does the error say "terminal prompts disabled" if I never disabled anything?
This setting is sometimes added automatically by other programs, scripts, or system administrators (especially on work computers). It can also be set in your Git config file by accident. Run git config --global --list to check, and remove any prompt-related settings if they are there.