You need to create an SSH tunnel to communicate with GitLab.
1. Log in to your development server as your user and create a key.
ssh-keygen -t rsa
Follow the steps and create the passcode (which you can remember) as you need to pull and push the code from / to GitLab.
2. Now that you have created your key, we can copy it,
cat id_rsa.pub
Copy the output of this command (including ssh-rsa
) and add it to your GitLab profile. ( http://my-gitlab-server.com/profile/keys/new ).
3. Verify that you have the correct privilege for the project (s)
Make sure you are at least a role developer. (Screengrab roles: http://i.stack.imgur.com/DSSvl.jpg )
4. Now copy the project link
Enter your project and find the SSH link in the upper right corner;

5. Now back to your development server
Go to your directory where you want to work, and do the following:
$ git init $ git remote add origin <<project_url>> $ git fetch
Where <<project_url>>
is the link we copied in step 4.
You will be asked to enter a password (this is your ssh password, not your server password) and add the host to your known_hosts
file. After that, the project will start loading, and you can enjoy the development.
I did these steps on a CentOS 6.4 machine with Digital Ocean. But they should not be different from using Google CE.
Edit
Quote from Marty Penner reply this comment
I decided! Thanks to @sxleixer and @Alexander Wenzowski for this.
Apparently SELinux intervened in a non-standard location for the .ssh directory. I needed to run the following compute engine instance commands:
sudo yum -y install policycoreutils-python
See the full version here:
Google Cloud Engine Permission denied (publickey, gssapi-keyex, gssapi-with-mic)