How to Clone a Git Repository Into a Specific Folder?-DecodingDevops

How to Clone a Git Repository Into a Specific Folder?-DecodingDevOps

Clone a git repository into current folder

To clone a basic git repository we use below git clone command
git clone <clone_url>
in this command we are not specifying where to clone the repository. so it will clone the git repository into current folder that means it will create a directory called as your repository name in current folder and it will initialize the .git directory inside the directory and it will pull the all code from git repo and it will check the working copy of the latest version.

Clone a Git repository into a specific folder

To clone a git repository into specific folder we use below command

git clone <cloning_url> </fath/to/the/folder>

Here we are mentioning where to clone the repository. so it will clone the repository into that specified path. That means it will do the same as mentioned in above basic git cloning, but not in current folder this time it will create a directory as repo name in your mentioned path.

Ex:

git clone https://github.com/decodingdevops/decodingdevops.git  /home/devops/vijay

So it will clone a git repository into /home/devops/vijay path. After executing this command go into that folder and see the cloning repo with ls command
cd /home/devops/vijay
ls
Here you can see your repo as directory go inside the repo directory and you can see all your repo files.

  • how to clone a git repo in specific folder
  • how to clone a git repository in a specific folder
  • clone a git repository in a specific folder

 

Leave a Reply

Your email address will not be published. Required fields are marked *