git-remotes

v1.0.2
Fetch git remotes (A nice parsed version of `git remote -v`)
git remote

git-remotes

NPM Build Status

Fetch git remotes (A nice parsed version of git remote -v).

Runs git remote -v, grabs the result, parses each remote out of it and produces an array of objects out of it.

Installation

npm install git-remotes

Usage

Require module

var gitRemotes = require('git-remotes');

Retrieving git remotes for the current directory

gitRemotes(function (err, remotes) {
  if (err) {
    //do something with the error
  }

  console.log(remotes)
  // -> so long as `err` is null,
  //`remotes` is always an array with 0 or more objects
  // representing git remotes
})

Retrieving git remotes for a specified directory

gitRemotes('./path/to/directory', function (err, remotes) {
  // ...
})

Remote objects

remotes is an array of remote objects that look like:

[
  {
    name: 'origin'
    url: '[email protected]:digitalsadhu/git-remotes.git'
  },
  //...
]
npm i git-remotes

Metadata

  • MIT
  • Whatever
  • Richard Walker
  • released 8/16/2015

Downloads

Maintainers