Git clone: SSH vs HTTPS
SSH Method
git clone [email protected]:group/project.git
Git uses:
- SSH keys (generated on local)
- stored at local .ssh folder
- SSH protocol
- Asymmetric cryptography
Auth:
- Authentication happens using private key (on your pc) and public key (uploaded to GitLab)
- No need password each time
- Convenient & Secure
HTTPS Method
git clone <https://gitlab.xpaas.lenovo.com/group/project.git>
Git uses:
- HTTP protocol (like a browser)
- Username + PAT (long random string)
- since real password not allowed
- stored at Github server
Auth:
- Username + Personal Access Token
-
Needs setup: GitLab → User Settings → Access Tokens
-
Configure Git Credential Manager
git config--global credential.helper manager