Skip to content

Support git config #64

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

Closed
nkoterba opened this issue Feb 27, 2015 · 6 comments
Closed

Support git config #64

nkoterba opened this issue Feb 27, 2015 · 6 comments

Comments

@nkoterba
Copy link

First, excellent gulp plugin! Really helpful and useful so thanks for your effort.

Second, is it possible to add support for 'git config' to the plugin?

Here's the git man page for it: http://git-scm.com/docs/git-config

Here's an example of how it could be used:

git.config({args: 'core.sparsecheckout true'}, function (err) {
        if (err) throw err;
    });
@stephenlacy
Copy link
Owner

Thanks, adding more non-file based git commands would create a much harder to manage massive plugin. This goes against gulp guidelines.

Referring to #56, use the git.exec function: https://github.com/stevelacy/gulp-git/blob/master/lib/exec.js

@nkoterba
Copy link
Author

@stevelacy Ok. Thanks for the info! I searched the issues for 'config' and nothing came up so I created this one. In the end, I resulted to using node.process_child.exec which it looks like git.exec does internally. I missed the git.exec as it was down the page and past the 'init' documentation section which is where I was looking to setup the git repo after the 'init' call.

@stephenlacy
Copy link
Owner

Ah, yes it is rather hard to notice.

@gucong3000
Copy link
Contributor

gucong3000 commented Jul 20, 2017

I 'd like push a PR to do this.

const git = require('gulp-git')({
  cwd: '~/work/git/gulp-git/', // cwd of child process
  pager: false,                // `--no-pager` from `git`.
  config: {                    // `-c` from `git`, key-value pairs
    "core.sparsecheckout": true,
    "user.email": "[email protected]",
    "user.name": "Your Name",
  }
});

git.commit(...);

@gucong3000
Copy link
Contributor

@stephenlacy
Copy link
Owner

I do not want to increase the API of this project.

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

3 participants