I am trying to clone repo from another directory.
Lets say I have one repo in C:/folder1
and C:/folder2
I want to clone the work in folder1
into folder2
.
What would I type into the command prompt to do this?
It seems that often when cloning a URL is provided rather then a file path, however, at this moment I am just practicing and trying to get use to Git.
About cloning a repository You can push your changes to the remote repository on GitHub.com, or pull other people's changes from GitHub.com. For more information, see "Using Git". You can clone your existing repository or clone another person's existing repository to contribute to a project.
This can be done by cloning to a new directory, then moving the . git directory into your existing directory. If your existing directory is named "code". This can also be done without doing a checkout during the clone command; more information can be found here.
cd /d c:\ git clone C:\folder1 folder2
From the documentation for git clone
:
For local repositories, also supported by git natively, the following syntaxes may be used:
/path/to/repo.git/ file:///path/to/repo.git/
These two syntaxes are mostly equivalent, except the former implies --local option.
It is worth mentioning that the command works similarly on Linux:
git clone path/to/source/folder path/to/destination/folder
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With