Configuration of SSH and HTTP in gitlab environment


After the gitlab environment is deployed, there are two ways to download gitlab code locally or remotely: SSH and HTTP

1) SSH: a relatively secure way, which requires uploading the local public key to gitlab: Profile Settings > SSH keys > add an SSH key

SSH mode can be used in three modes of gitlab
Window client sets SSH mode to connect to gitlab, refer to: at the bottom of the article)

2) HTTP connection mode, only “public” public status can be selected
You can’t use HTTP to connect in private mode and internal private mode
HTTP direct connection to gitlab is not as secure as SSH connection, but you can also make some security settings, such as making port restrictions in the iptables of gitlab (port 8081 above) and adding a white list

git config --global  Wang Bo
git config --global ""
git clone

git add
git commit -m "add README"
git push -u origin master

Note the permissions of members in the warehouse. If a gitlab user does not set the permissions of members, the GIT clone operation can be performed, but the GIT push operation will fail: remote: gitlab: you are not allowed to push code to protected branches on this project