DEV Community

Wycliffe A. Onyango
Wycliffe A. Onyango

Posted on

100 Days of DevOps: Day 22

Cloning Git Repository on Storage Server

Step 1: Secure Shell (SSH) Access

You first connect to the remote server using the SSH protocol. This is a secure method for communicating with a server. The SSH command you use to access the server's command line is typically ssh serverusername@servername or ssh serverusername@serverip_address.

Step 2: Cloning the Repository

Once you're connected via SSH, you can use the git clone command to create a copy of a repository.

The command is:
sudo git clone /opt/media.git /usr/src/kodekloudrepos/media

  • sudo: This elevates your privileges to run the command as a superuser, which is necessary if the destination directory (/usr/src/kodekloudrepos/media) requires root permissions to write to it.
  • git clone: This is the core command for making a copy of a repository.
  • /opt/media.git: This is the source of the repository you are cloning. In this case, it's a local bare repository located in the /opt directory.
  • /usr/src/kodekloudrepos/media: This is the destination where the repository will be cloned. It creates a new directory named media and places all the repository's files inside it.

The repository's name is media, derived from the source repository's directory name.

Step 3: Verifying the Cloned Repository

I used the following command to confirm that the cloning process was a successls -a /usr/src/kodekloudrepos/media

Top comments (0)