Setting up your GitLab account#

Sign Up for a GitLab Account#

  1. Open your web browser and go to the GitLab sign-up website.

  2. In the registration page you can choose between different sign-up options. You can sign up using your Google, GitHub, or GitLab account, or you can create a new account by providing your email address and a password. If you choose to sign up with your email address, enter your email in the designated field and create a strong password. Make sure to follow any password requirements that GitLab may have.

  3. After entering your email and password, click on the “Register” button to proceed. GitLab may send you a confirmation email to verify your email address. Check your inbox and follow the instructions in the email to complete the verification process.

  4. Once your email is verified, you will be redirected to your GitLab account dashboard. From here, you can start creating and managing your repositories, collaborate with others, and explore the various features offered by GitLab.

Add your public SSH Keys from Your Computer to GitLab#

Copying SSH keys from your computer to GitLab allows you to securely authenticate with GitLab repositories without having to enter your username and password each time. Here’s a quick guide on how to do it:

  1. Locate Your SSH Keys:

    • Open a terminal or command prompt on your computer.

    • Navigate to the directory where your SSH keys are stored. By default, SSH keys are usually stored in ~/.ssh/ directory on Unix-like systems (such as Linux or macOS) or C:\Users\YourUsername\.ssh\ directory on Windows.

  2. Generate SSH Keys (if you don’t have them already):

    • If you don’t have SSH keys yet, you can generate them using the ssh-keygen command:

      ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
      
    • Follow the prompts to generate the keys. Press Enter to accept the default file location (~/.ssh/id_rsa) and no passphrase, or customize it as needed.

  3. Display Your Public SSH Key:

    • Use the cat command to display your public SSH key:

      cat ~/.ssh/id_rsa.pub
      
    • This will output your public SSH key to the terminal.

  4. Copy Your Public SSH Key:

    • Select the entire content of your public SSH key displayed in the terminal, starting with ssh-rsa and ending with your email address.

    • Copy the selected text to your clipboard.

  5. Add SSH Key to GitLab:

    • Log in to your GitLab account.

    • Click on your profile avatar in the upper right corner and select “Preferences” from the dropdown menu.

    • In the left sidebar, click on “SSH Keys”.

    • Paste the copied public SSH key into the “Key” field.

    • Optionally, provide a descriptive title for the key in the “Title” field (e.g., “My Laptop SSH Key”).

    • Click the “Add key” button to save the SSH key.

  6. Verify SSH Key Addition:

    • To verify that your SSH key has been successfully added, you can use the following command:

      ssh -T git@gitlab.com
      
    • If the key was added correctly, you will see a message confirming your connection to GitLab.

That’s it! You’ve successfully copied your SSH key from your computer to GitLab, allowing you to securely authenticate with GitLab repositories using SSH.