|
4 years ago | |
---|---|---|
.. | ||
LICENSE | 4 years ago | |
README.md | 4 years ago | |
index.js | 4 years ago | |
package.json | 4 years ago |
README.md
remote-origin-url

Get the git remote origin URL from your local git repository. Remember! A remote origin must exist first!
Install
Install with npm:
$ npm install --save remote-origin-url
Install with bower
$ bower install remote-origin-url --save
Usage
Using the defaults:
var remoteOriginUrl = require('remote-origin-url');
remoteOriginUrl(function(err, url) {
if (err) return console.log(err);
console.log(url);
// url => "https://github.com/jonschlinkert/remote-origin-url.git"
});
Specify the cwd
to use:
remoteOriginUrl(process.cwd(), function(err, url) {
if (err) return console.log(err);
console.log(url);
// url => "https://github.com/jonschlinkert/remote-origin-url.git"
});
sync
console.log(remoteOriginUrl.sync());
//=> "https://github.com/jonschlinkert/remote-origin-url.git"
Specify the cwd
to use:
console.log(remoteOriginUrl.sync(process.cwd()));
//=> "https://github.com/jonschlinkert/remote-origin-url.git"
About
Related projects
- git-config-path: Resolve the path to the user's local or global .gitconfig. | homepage
- git-user-name: Get a user's name from git config at the project or global scope, depending on… more | homepage
- git-username: Get the username from a git remote origin URL. | homepage
- is-git-url: Regex to validate that a URL is a git url. | homepage
- parse-github-url: Parse a github URL into an object. | homepage
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Contributors
Commits | Contributor |
---|---|
27 | jonschlinkert |
3 | doowb |
Building docs
(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)
To generate the readme, run the following command:
$ npm install -g verbose/verb#dev verb-generate-readme && verb
Running tests
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
$ npm install && npm test
Author
Jon Schlinkert
License
Copyright © 2017, Jon Schlinkert. Released under the MIT License.
This file was generated by verb-generate-readme, v0.6.0, on July 11, 2017.