{"id":15700076,"url":"https://github.com/jonschlinkert/git-add-remote","last_synced_at":"2025-05-12T13:08:50.489Z","repository":{"id":65990685,"uuid":"88800753","full_name":"jonschlinkert/git-add-remote","owner":"jonschlinkert","description":"API for adding git remotes.","archived":false,"fork":false,"pushed_at":"2017-04-20T01:40:28.000Z","size":8,"stargazers_count":6,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-29T16:09:43.963Z","etag":null,"topics":["add","api","git","javascript","nodejs","remote"],"latest_commit_sha":null,"homepage":"https://github.com/jonschlinkert/git-add-remote","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonschlinkert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/contributing.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-19T23:43:40.000Z","updated_at":"2021-04-12T22:31:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"18e77026-e5c2-4056-ac4b-b8774aabe643","html_url":"https://github.com/jonschlinkert/git-add-remote","commit_stats":{"total_commits":5,"total_committers":1,"mean_commits":5.0,"dds":0.0,"last_synced_commit":"5c06c3e8954dbe57d487d612c5326941e363ee26"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fgit-add-remote","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fgit-add-remote/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fgit-add-remote/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fgit-add-remote/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonschlinkert","download_url":"https://codeload.github.com/jonschlinkert/git-add-remote/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253745160,"owners_count":21957317,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["add","api","git","javascript","nodejs","remote"],"created_at":"2024-10-03T19:45:14.110Z","updated_at":"2025-05-12T13:08:50.446Z","avatar_url":"https://github.com/jonschlinkert.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# git-add-remote [![NPM version](https://img.shields.io/npm/v/git-add-remote.svg?style=flat)](https://www.npmjs.com/package/git-add-remote) [![NPM monthly downloads](https://img.shields.io/npm/dm/git-add-remote.svg?style=flat)](https://npmjs.org/package/git-add-remote)  [![NPM total downloads](https://img.shields.io/npm/dt/git-add-remote.svg?style=flat)](https://npmjs.org/package/git-add-remote) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/git-add-remote.svg?style=flat\u0026label=Travis)](https://travis-ci.org/jonschlinkert/git-add-remote)\n\n\u003e API for adding git remotes.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save git-add-remote\n```\n\nInstall with [yarn](https://yarnpkg.com):\n\n```sh\n$ yarn add git-add-remote\n```\n\n## Usage\n\nThe main export is a function that must be called with the current working directory to initialize git from. Leave it undefined to use `process.cwd()`.\n\n```js\nvar cwd = 'foo/bar';\nvar addRemote = require('git-add-remote')(cwd);\n\n// async\naddRemote(name, url, callback);\n\n// sync (requires node.js v0.11.12 or higher)\naddRemote.sync(name, url);\n```\n\n## async\n\n**Examples**\n\n```js\nvar addRemote = require('git-add-remote')();\n\naddRemote('foo', 'https://foo.git', function(err) {\n  if (err) return console.log(err);\n});\n```\n\n## sync\n\n**Examples**\n\n```js\nvar addRemote = require('git-add-remote')();\n\naddRemote.sync('foo', 'https://foo.git');\naddRemote.sync('bar', 'https://bar.git');\naddRemote.sync('baz', 'https://baz.git');\n```\n\n## About\n\n### Related projects\n\n* [gfc](https://www.npmjs.com/package/gfc): Simple way to initialize a new git repository in an empty directory, add a file… [more](https://github.com/jonschlinkert/gfc) | [homepage](https://github.com/jonschlinkert/gfc \"Simple way to initialize a new git repository in an empty directory, add a file and do a first commit (or skip that part in a directory with files). Useful for unit tests and generators.\")\n* [git-branch](https://www.npmjs.com/package/git-branch): Get the current branch for a local git repository. | [homepage](https://github.com/jonschlinkert/git-branch \"Get the current branch for a local git repository.\")\n* [git-user-email](https://www.npmjs.com/package/git-user-email): Get the email address of the current user from git config. | [homepage](https://github.com/jonschlinkert/git-user-email \"Get the email address of the current user from git config.\")\n* [git-user-name](https://www.npmjs.com/package/git-user-name): Get a user's name from git config at the project or global scope, depending on… [more](https://github.com/jonschlinkert/git-user-name) | [homepage](https://github.com/jonschlinkert/git-user-name \"Get a user's name from git config at the project or global scope, depending on what git uses in the current context.\")\n* [git-username](https://www.npmjs.com/package/git-username): Get the username from a git remote origin URL. | [homepage](https://github.com/jonschlinkert/git-username \"Get the username from a git remote origin URL.\")\n* [list-git-remotes](https://www.npmjs.com/package/list-git-remotes): List the remotes for a local git repository. Sync and async. | [homepage](https://github.com/jonschlinkert/list-git-remotes \"List the remotes for a local git repository. Sync and async.\")\n\n### Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\nPlease read the [contributing guide](.github/contributing.md) for advice on opening issues, pull requests, and coding standards.\n\n### Building docs\n\n_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme \u0026\u0026 verb\n```\n\n### Running tests\n\nRunning 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:\n\n```sh\n$ npm install \u0026\u0026 npm test\n```\n\n### Author\n\n**Jon Schlinkert**\n\n* [github/jonschlinkert](https://github.com/jonschlinkert)\n* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)\n\n### License\n\nCopyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.5.0, on April 19, 2017._","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonschlinkert%2Fgit-add-remote","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonschlinkert%2Fgit-add-remote","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonschlinkert%2Fgit-add-remote/lists"}