How do I do clone and put it in specific location?
var git = require('gulp-git');
// Clone a remote repo
gulp.task('clone', function(){
git.clone('https://git-location', './apps/');
});
I've been looking at documentation but I cannot find any.
Below are the output, after running the task
[11:17:05] Starting 'clone'...
[11:17:05] Finished 'clone' after 5.76 ms
[11:17:48] Cloning into 'undefined'...
When I run the task it is copying the file into undefined folder. Obviously, I am doing something wrong. Can anybody point it out to me?
Cloning only a subdirectory is not possible in Git. The network protocol doesn't support it, the storage format doesn't support it. Every single answer to this question always clones the whole repository.
The git clone command creates a copy of a remote repository on your local machine. By default, the clone command saves your code in a folder that shares the name of your repository. This can be overwritten by specifying a folder name after the URL of the repository you want to clone.
You can clone a specific branch from a Git repository using the git clone –single-branch –branch command. This command retrieves all the files and metadata associated with one branch. To retrieve other branches, you'll need to fetch them later on.
Thanks to S.Lacey (one of the publishers of gulp-git) for prompt response to my question. Below is the right format.
git.clone("https://git-location",{cwd: "./apps/"});
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