Ops. https://gitlab.com': terminal prompts disabled
Ops. Username for 'https://codeberg.org':
Ops. etc
If you see this message, there is a short solution how to fix it here. In my case it appeared and it did not want to get fixed by many ways that are offered on the internet.
Some of the pieces of advice that did not work:
- Set
git config --global --add credential.helper manager
- To add GIT_TERMINAL_PROMPT=1 to the enviroments.
- Use HTTPS authentification instead of SSH
- etc.
The actual reason is you do not have a key pair to work with your repository and/or you did not update git settings to use ssh.
step 1. Create a key pair. Fallowing the description on the page https://docs.gitlab.com/ee/ssh/, just add the public key
to your SSH setting on gitlab.com, put your private key to .ssh folder (in my case it was id_rsa file) and check if it
works by ssh -T [email protected]
command (ssh -T [email protected]
, ssh -T [email protected]
).
It will allow to access your repository using a private key.
step 2. Only for Golang: Point out that your repository or repositories are private. Use come to deparate patterns/repos.
Set go env -w GOPRIVATE="gitlab.com/your_name*,github.com/your_name*,codeberg.org/your_name*"
.
step 3. Set git config --global url."[email protected]:".insteadOf "https://gitlab.com/"
. This will make Git use ssh to fetch and push changes (https must be disabled) even if you use https link to clone.
step 4. Optional: If you cloned a repo using https before to fix your settings in .gitconfig, like:
git clone https://codeberg.org/your_name/your_repo.git
you need to switch that repo to ssh. Go to the repo folder and run:
git remote set-url origin [email protected]:your_name/your_repo.git
After the key is used, all the private packages are pulled and pushed without any trouble.
And you, my friend, are a true hero!