Git- Clone Operations – POFTUT

Git- Clone Operations

We have all ready a repository. Other developer Ken wants to join our project and give code support. How can we do that with with Git. Git have clone mechanism to copy existing repository easily.

$ git clone /home/john/myproject/ . 
Cloning into '.'... 
$ ls

As we see we have cloned it with clone command. /home/john/myproject/ is the path where existing repository resides. . is the the path where we want to clone. If we omit . by default current working path is the destination directory.

New Target Directory Name

We can give new directory name while cloning repository.

$ git clone /home/john/myproject/ yourproject 
Cloning into 'yourproject'... 
  • /home/john/myproject is our source directory
  • youproject is new directory name

Clone Protocol Suport

We have clone local path git repositories but what happens if we try to clone http hosted project. Nothing it just clones the project. Git support http, https, ssh, git protocols as transmission protocol.

Distributed Development

Traditional version control systems uses centralized servers to make system concurrent. Git is different from them. Repositories are complete cloned to the new developers.

LEARN MORE  Linux "X11 Connection Rejected Because of Wrong Authentication" Error and Solution

Leave a Comment