Skip to content

Commit

Permalink
add git clone example with destination - #95
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenlacy committed Oct 13, 2015
1 parent b3eecfe commit 62892b1
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,12 @@ gulp.task('clone', function(){
});
});

// Clone remote repo to sub folder ($CWD/sub/folder/git-test)
gulp.task('clonesub', function() {
git.clone('https://github.com/stevelacy/git-test', {args: './sub/folder'}, function(err) {
// handle err
});
});

// Tag the repo with a version
gulp.task('tag', function(){
Expand Down Expand Up @@ -286,6 +292,12 @@ git.clone('https://remote.git', function (err) {
//if (err) ...
});
```
A desination folder or subfolder can be set with `args: '<destination>'`
```
git.clone('https://remote.git', {args: './sub/folder'} function (err) {
//if (err) ...
});
```

### git.add(opt)
`git add <files>`
Expand Down
14 changes: 14 additions & 0 deletions examples/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,20 @@ gulp.task('commitmulti', function(){
.pipe(git.commit(['initial commit', 'additional message']));
});

// Clone remote repo to current directory ($CWD/git-test)
gulp.task('clone', function() {
git.clone('https://github.com/stevelacy/git-test', function(err) {
// handle err
});
});

// Clone remote repo to sub folder ($CWD/sub/folder/git-test)
gulp.task('clonesub', function() {
git.clone('https://github.com/stevelacy/git-test', {args: './sub/folder'}, function(err) {
// handle err
});
});

// Add remote

gulp.task('remote', function(){
Expand Down

0 comments on commit 62892b1

Please sign in to comment.