2019-10-12 21:52:04 +05:30
---
2020-10-24 23:57:45 +05:30
stage: Create
group: Source Code
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/#designated-technical-writers"
2019-10-12 21:52:04 +05:30
type: howto
---
2020-10-24 23:57:45 +05:30
2020-04-08 14:13:33 +05:30
# Create and add your SSH key pair
2015-09-11 14:41:01 +05:30
2020-11-24 15:15:51 +05:30
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-09-11 14:41:01 +05:30
2020-04-08 14:13:33 +05:30
1. Create an SSH key pair
1. Add your SSH public key to GitLab
2015-09-11 14:41:01 +05:30
2019-09-04 21:01:54 +05:30
## Creating your SSH key pair
2020-05-24 23:13:21 +05:30
1. Go to your [command line ](start-using-git.md#command-shell ).
2019-10-12 21:52:04 +05:30
1. Follow the [instructions ](../ssh/README.md#generating-a-new-ssh-key-pair ) to generate
your SSH key pair.
2019-09-04 21:01:54 +05:30
## Adding your SSH public key to GitLab
2019-10-12 21:52:04 +05:30
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-09-11 14:41:01 +05:30
2019-07-07 11:18:12 +05:30
NOTE: **Note:**
2020-11-24 15:15:51 +05:30
Once you add a key, you can't edit it. If it did not paste properly, it
2019-10-12 21:52:04 +05:30
[will not work ](../ssh/README.md#testing-that-everything-is-set-up-correctly ), and
2020-11-24 15:15:51 +05:30
you need to remove the key from GitLab and try adding it again.