Skip to content
This repository was archived by the owner on Apr 14, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ gulp.task('deploy', function() {

Only trigger deployment on the following branch(es). Defaults to `master`.

- `ignoreRemoval`

Based on `git add`'s `--ignore-removal` option.
If `true`, files will not be removed from the remote repo. If `false`, files will be removed from the remote repo if they do not exist in the source files.
Defaults to `false`.

- `verbose`

Verbose mode. Will show output from all git commands run. Defaults to `false`.
Expand Down
8 changes: 7 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module.exports = function(options) {
repository: '',
remoteBranch: 'master',
branches: ['master'],
ignoreRemoval: false,
verbose: false,
debug: false
}, options);
Expand Down Expand Up @@ -148,7 +149,12 @@ module.exports = function(options) {
}
},
function gitAdd(callback) {
var cmdAdd = spawn('git', ['add', '--all', '.'], {cwd: repoPath});
var removalType = '--all';
if (options.ignoreRemoval){
removalType = '--ignore-removal';
if (options.verbose || options.debug) gutil.log(gutil.colors.magenta('git add: ignoring deleted files'));
}
var cmdAdd = spawn('git', ['add', removalType, '.'], {cwd: repoPath});
cmdAdd.stderr.on('data', function(data) {
if (options.verbose || options.debug) gutil.log(gutil.colors.magenta('git add: ') + data.toString().trim());
});
Expand Down