i am writing my bachelors thesis at a company and got access to gitlab from the admin, but I am new to Git. I created a new project for my thesis. I already had a folder with some stuff on my computer. I used the following commands in the git bash (as recommended by gitlab):
git init
git remote add origin git@gitlab:USER/TITLE.git
git add [stuff]
git commit
git push -u origin master
Committing was successfull, but the last command created the error
"ssh: connect to host gitlab port 22: Connection refused fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists."
I tried to switch to port 443, because apparently, that is a thing.
ssh -T -p 443 [email protected]
That got me:
"The authenticity of host '[altssh.gitlab.com]:443 ([35.190.168.187]:443)' can't be established.
ECDSA key fingerprint is [...].
Are you sure you want to continue connecting (yes/no/[fingerprint])?"
After typing yes:
"Warning: Permanently added '[altssh.gitlab.com]:443,[35.190.168.187]:443' (ECDSA) to the list of known hosts.
[email protected]: Permission denied (publickey)."
When going back to port 22, the connection timed out. The error after the push command is still the same.
According to canyouseeme.org, the ports 22 and 443 are not open.
I also tried to make new rules for the ports in the windows defender firewall menu.
Still the same error. I would really appreciate any help or ideas from you :)
Peter
I solved it, it was not that hard. ssh does not work, everyone uses http here. I copied the wrong url from gitlab.
the command I had to use is:
git remote set-url origin http://gitlab/USER/PROJECT.git
Check if you are not behind a VPN, I spent like half an hour before I thought about that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With