2019-07-30 01:02:59 -04:00
---
2020-07-29 08:09:45 -04:00
stage: Create
group: Source Code
2020-11-26 01:09:20 -05:00
info: "To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments"
2019-07-30 01:02:59 -04:00
type: howto
---
2020-07-29 08:09:45 -04:00
2020-03-11 14:09:23 -04:00
# Create and add your SSH key pair
2015-06-22 11:54:40 -04:00
2020-09-02 23:08:12 -04:00
It's best practice to use [Git over SSH instead of Git over HTTP ](https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols ).
In order to use SSH, you need to:
2015-06-22 11:54:40 -04:00
2020-03-11 14:09:23 -04:00
1. Create an SSH key pair
1. Add your SSH public key to GitLab
2015-06-22 11:54:40 -04:00
2019-05-29 10:33:32 -04:00
## Creating your SSH key pair
2020-04-24 11:09:37 -04:00
1. Go to your [command line ](start-using-git.md#command-shell ).
2019-07-30 01:02:59 -04:00
1. Follow the [instructions ](../ssh/README.md#generating-a-new-ssh-key-pair ) to generate
your SSH key pair.
2019-05-29 10:33:32 -04:00
## Adding your SSH public key to GitLab
2019-07-30 01:02:59 -04:00
To add the SSH public key to GitLab, see
[Adding an SSH key to your GitLab account ](../ssh/README.md#adding-an-ssh-key-to-your-gitlab-account ).
2015-06-22 11:54:40 -04:00
2019-03-14 12:26:27 -04:00
NOTE: **Note:**
2020-09-02 23:08:12 -04:00
Once you add a key, you can't edit it. If it did not paste properly, it
2019-07-30 01:02:59 -04:00
[will not work ](../ssh/README.md#testing-that-everything-is-set-up-correctly ), and
2020-09-02 23:08:12 -04:00
you need to remove the key from GitLab and try adding it again.