How to Connect CLI to Copado Version Control via SSH

Updated 5 days ago by Copado Solutions

Copado provides the option of IP Whitelisting, to ensure that the traffic is limited by source. Due to security reasons, we highly recommend enforcing IP whitelisting. To enable this, contact Copado Support.

Now, let's take a look at the steps to connect CLI to Copado Version Control via SSH.

  1. First, you need to check if you have a local SSH key by typing: cat ~/.ssh/ 
  2. If the command returns:
    1.  No such file or directory you need to create a SSH key.
    No such file or directory
    1.  To do so, open your local terminal, type in: ssh-keygen, and press enter 4 times. See the below example: 
    Create a SSH key
    1. If it returns the public key, you don’t need to create a new SSH key. Below is an example of a printed public key. 
    Public key example
  3. Type in: cat ~/.ssh/ to print your public key and copy it.
Print your public key example

  1. Login to Copado Version Control.
  2.  Click on your profile and select Settings
Settings in Copado Version Control

  1. Click on SSH/GPG Keys
  2. On the Manage SSH key section, click on Add Key.
    Add Key
    1. Give your key a name.
    2. Paste the public key that was copied into the Content box. 
    3. When ready, click on Add Key.
Fill information for Add Key
  1. Navigate to a repository that you want to clone.
  2. Click on the SSH button.
  3. Click on the copy button.
SSH button

  1. Navigate to your local terminal and go to the directory where you want to clone it.
    1. Type in git clone <paste what was copied from number 13>. It will ask if you are sure to continue, just type yes.
      Example of a directory you want to clone
    2. Type in ls in MAC or dir in Windows and it will print out the cloned repository. 
      How to print out a cloned repository
    3. Now you are able to go inside the repository and add new files/folders.
      Add new files/folders on a cloned repository
    4. To push the files and folders you added run the following commands:
      1) git add .
      2) git commit -am “testing push”
      3) git push
How-to push the files and folders you added on a cloned repository

  1. You can now see the pushed files and folders on the Copado Version Control web browser.
Example of pushed files and folders of a cloned repository

How did we do?