Setup new device
Define the user
git config --global user.name "<username>"
git config --global user.email "<email>"
Add access with ssh
(Optionnal) Generate an ssh key pair
If you have not already an ssh key pair, you can generate one with this command (let the default values):
ssh-keygen -t ed25519 -C "<username>@<servername>"
(Optionnal) Authorize this key to connect to this server
cat .ssh/id_ed25519.pub >> .ssh/authorized_keys
Add your public key into your gitlab account
- Find your public (with .pub) key inside the .ssh folder of your home (
id_ed25519.pub) - Go to your gitlab profile page for adding your key.
You can know push and pull from your distant repositories.
(Optionnal) Connect to docker registry
- Generate a new personnal access token with read_registry scope: https://gitlab.com/-/profile/personal_access_tokens
- Login with docker:
docker login registry.gitlab.com