Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to clone to specific folder? #32

Closed
maridob opened this issue Jul 1, 2014 · 5 comments
Closed

How to clone to specific folder? #32

maridob opened this issue Jul 1, 2014 · 5 comments

Comments

@maridob
Copy link

maridob commented Jul 1, 2014

var git = require('gulp-git');
// Clone a remote repo
gulp.task('clone', function(){
git.clone('https://git-location', './apps/');
});

This one is running but it is creating an undefined folder and copying all the files there. Am I doing something wrong or is this possible?

@stephenlacy
Copy link
Owner

git.clone("url", {cwd: "./apps/"});

@maridob
Copy link
Author

maridob commented Jul 1, 2014

Great! Awesome thanks! :-)

@ChezCrawford
Copy link

It seems like this folder has to exist before running the command above? Is that correct?

On the other hand, if you do something like:

git.clone("url", {args: "./apps/"});

Then the directory will be created if it does not exist.

@stephenlacy
Copy link
Owner

Yes, git requires the directory to exist with cwd, while setting the args to the wanted path would do this:
git clone https://github.com/org/repo apps
Probably using the args would be better.

@matbo81
Copy link

matbo81 commented Feb 3, 2017

I want:
call a git commit command to a repo in another repo than my gulpfile is.
But that ways (1,2) not working:
1.)
gulp.task('commit', function() {
gulp.src('folder_git')
.pipe(git.commit(commit_msg, {args: 'folder_git', maxBuffer: 200 * 1024, quiet: true, disableMessageRequirement: false, disableAppendPaths: false, multiline: false}));
});
2:)
gulp.task('commit', function() {
gulp.src('folder_git')
.pipe(git.commit(commit_msg, {args: '', cwd:'folder_git', maxBuffer: 200 * 1024, quiet: true, disableMessageRequirement: false, disableAppendPaths: false, multiline: false}));
});
All it does is to call the commit on that repo the gulpfile is...
(with clone, it works perfectly)
Have someone an idea?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants