Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gulp-git clone in specific folder location. Cloned to 'undefined' folder

Tags:

git

gulp

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?

like image 287
maridob Avatar asked Jul 01 '14 16:07

maridob


People also ask

Can you clone just a folder from git?

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.

When I git clone where does it go?

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.

How do I clone a specific branch?

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.


1 Answers

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/"});
like image 100
maridob Avatar answered Oct 31 '22 13:10

maridob