How to Connect CLI to Copado Version Control via SSH
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.
- First, you need to check if you have a local SSH key by typing: cat ~/.ssh/id_rsa.pub
- If the command returns:
- No such file or directory you need to create a SSH key.
- To do so, open your local terminal, type in: ssh-keygen, and press enter 4 times. See the below example:
- 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.
- Type in: cat ~/.ssh/id_rsa.pub to print your public key and copy it.
- Login to Copado Version Control.
- Click on your profile and select Settings.
- Click on SSH/GPG Keys.
- On the Manage SSH key section, click on Add Key.
- Give your key a name.
- Paste the public key that was copied into the Content box.
- When ready, click on Add Key.
- Navigate to a repository that you want to clone.
- Click on the SSH button.
- Click on the copy button.
- Navigate to your local terminal and go to the directory where you want to clone it.
- Type in git clone <paste what was copied from number 13>. It will ask if you are sure to continue, just type yes.
- Type in ls in MAC or dir in Windows and it will print out the cloned repository.
- Now you are able to go inside the repository and add new files/folders.
- To push the files and folders you added run the following commands:
1) git add .
2) git commit -am “testing push”
3) git push
- You can now see the pushed files and folders on the Copado Version Control web browser.