1
0
Fork 0
docs/articles/git/setup_configuration/Readme.md

1.3 KiB

Git setup and configuration

Git setup

To clone this repository both git and git LFS (Large File Storage) must be installed on the target (host) machine:

sudo apt install git git-lfs

To complete the configuration:

git config --global user.name "<name surname>"
git config --global user.email "<e-mail address>"

Repository configuration

To clone the repository via ssh:

  1. Generate an SSH key pair using the following command. When prompted for passphrase press enter to leave the field blank.
ssh-keygen -t rsa -b 4096 -C "<e-mail address>"
  1. Add the ssh key to the ssh agent:
eval "$(ssh-agent -s)"

ssh-add ~/.ssh/id_rsa
  1. Copy the ssh key to clipboard:
sudo apt-get install xclip

cat ~/.ssh/id_rsa.pub | xclip -selection clipboard
  1. Add the ssh key to GitLab account:

    1. Access GitLab profile
    2. Navigate to "Preferences" -> "SSH Keys" then press "Add new key"
    3. Paste the text copied at the previous step in the "Key" field and remove the Expiration Date, then press "Add key"
  2. Now the project can be cloned using the following command, specifying "yes" when promped for the ssh key:

git clone git@gitlab.com:HMDrive/hmd_project.git