Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    gitconfiglocalpublic

    Build Status

    gitconfiglocal

    parse the .git/config file into a useful data structure

    example

    • search config in $GIT_DIR (.git by default)
    var gitconfig = require('gitconfiglocal');
     
    gitconfig('./',function(err,config){
      console.log(config);
      /* prints:
      { core:
         { repositoryformatversion: '0',
           filemode: true,
           bare: false,
           logallrefupdates: true },
        remote:
         { origin:
            { url: 'git@github.com:soldair/node-gitconfiglocal.git',
              fetch: '+refs/heads/*:refs/remotes/origin/*' } } }
      */
    });
     
    • specify $GIT_DIR via options:
    gitconfig('./', { gitDir: 'path/to/gitdir' }, cb);
     

    Keywords

    install

    npm i gitconfiglocal

    Downloadsweekly downloads

    193,930

    version

    2.0.1

    license

    BSD

    repository

    github.com

    last publish

    collaborators

    • avatar