Last updated 20 February 2017.

Once you have created a sandbox project or created a full project on and written code for this project, you can push your locally-saved code up to using Git. For step-by-step instructions on pushing your project code, visit your project's page on and click the Version control tab as shown below.

Click the SSH keys link in your profile page

When you push code to, you are required to use Secure Shell protocol (SSH protocol). You must authenticate using SSH whenever you interact with the remote repository on, for example when using commands such as git push, git fetch, and git pull. You can authenticate in one of two ways:

  • Providing your password
  • Providing SSH keys

Authenticating with your password

If you have not set up an SSH key in your account, Git will prompt you to authenticate using your password.

Authenticating with SSH Keys

The most common way to authenticate is using SSH keys. Although SSH keys are slightly more work to set up initially, they are far less hassle on a day-to-day basis. An SSH key is a pair of cryptgraphic keys consisting of a private key and a public key.

Private Key

The private key must be kept strictly confidential. You keep it to yourself and never send it by email, etc. You need a private key on every computer/account where you will use Git. allows you to use as many key pairs as you like. Thus, you can create a public/private key pair for each computer you use. But if you prefer using only one key pair for all of your computers, you can copy your private key to each of them.

Public Key

You share the public key on code repositories such as GitHub,, or any other SSH server you use. When you try to connect to the repository, the SSH system checks if your (local) private key corresponds with any of the (remote) public keys has. If there is a match, access is granted. You can share your public key with anyone at any time without compromising security.

Generating your keys


Adding your public key to

  1. Visit your profile page
  2. Click the SSH keys sub-tab > Add a public key link. Paste into the Key field the public key you generated in the section above, Generating your keys.
  3. Click Save.

The first time you connect

Every time you connect to with SSH, the server will authenticate itself, too. The first time you connect, your system will not know's public key and you'll see a prompt like the following one.

Note: Be sure to type yes at the prompt rather than just pressing Enter.

Initialized empty Git repository in /project/example/.git/
The authenticity of host ' (' can't be established.
RSA key fingerprint is 16:f5:44:6c:a1:c6:be:72:cd:98:b5:b7:7d:26:d6:14.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ',' (RSA) to the list of known hosts.

On some systems you may encounter "unable to negotiate" error. Check out the following issue for workaround: #2552319: git server using legacy cipher.

Frequently asked questions about SSH keys

What if I lose my private key?

You need to ask yourself if you are sure that nobody possesses your private key. If you are not sure, create a new pair of keys and replace the old ones.

What if somebody else may possess my private key?

Immediately go into your account and delete your public key in "Your Dashboard Profile: "SSH keys". Check all repositories you can write to for commits you didn't do.

Why do I need a username if I'm using SSH keys?

You don't! You can use also use the familiar[projectname].git. We don't document it in most instructions because our documentation tries to accommodate the least complex entry point. That means password-based authentication, which means using the Git username.

How do I initialize my SSH key on Windows with msysgit/cmd/cygwin/TortoiseGit?

If you installed Git/msysgit with the recommended "Use (Tortoise)Plink" option, after setting up your SSH keys, when trying to use git on the command line, you may get the following error:

# git clone [...]

Cloning into drupal...
The server's host key is not cached in the registry. You
have no guarantee that the server is the computer you
think it is.
The server's rsa2 key fingerprint is:
ssh-rsa 2048 16:f5:44:6c:a1:c6:be:72:cd:98:b5:b7:7d:26:d6:14
Connection abandoned.
fatal: The remote end hung up unexpectedly

To resolve this error:

  1. Start PuTTY
  2. Connect to host
  3. Confirm the host's signature/fingerprint
  4. Cancel the connection (STRG + C)
  5. Done. git should be able to perform all operations regardless of shell now (regular Windows command prompt, msysgit, or cygwin)


thePanz’s picture

For a Windows/Putty guide I post an "howto" in my blog ( I've set up TortoiseGIT and Drupal SSH keys using Putty (and TortoisePLink) instead of msysgit. Comments are wolcome


mfb’s picture

Why do I need a username if I'm using SSH keys?
You don't! You can use also use the familiar[projectname].git.

This doesn't seem to be the case. If I use[projectname].git I get fatal: remote error: User 'git' does not have write permissions for repository when pushing.

ananes’s picture

You need add the key with ssh-add

diriy’s picture

$ git clone
Cloning into 'examples'...
Unable to negotiate with no matching key exchange method found. Their offer: diffie-hellman-group1-sha1
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

I don't know, what to do. It doesn't matter, what will I write, I have the same error. Could you help, please?