{"id":15905712,"url":"https://github.com/jlyonsmith/git-extra","last_synced_at":"2025-03-21T01:31:51.994Z","repository":{"id":33372548,"uuid":"156636328","full_name":"jlyonsmith/git-extra","owner":"jlyonsmith","description":"A command line tool for BitBucket operations, such as managing pull requests","archived":false,"fork":false,"pushed_at":"2023-01-07T04:00:12.000Z","size":2404,"stargazers_count":2,"open_issues_count":6,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-11T07:55:46.702Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/jlyonsmith.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-08T02:06:55.000Z","updated_at":"2022-07-06T21:39:32.000Z","dependencies_parsed_at":"2023-01-15T00:38:25.873Z","dependency_job_id":null,"html_url":"https://github.com/jlyonsmith/git-extra","commit_stats":null,"previous_names":["jlyonsmith/bitbucket-tool"],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlyonsmith%2Fgit-extra","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlyonsmith%2Fgit-extra/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlyonsmith%2Fgit-extra/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlyonsmith%2Fgit-extra/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jlyonsmith","download_url":"https://codeload.github.com/jlyonsmith/git-extra/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244097134,"owners_count":20397549,"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":[],"created_at":"2024-10-06T13:07:15.176Z","updated_at":"2025-03-21T01:31:51.624Z","avatar_url":"https://github.com/jlyonsmith.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Extra Git Commands\n\nA tool that creates some commands for working with BitBucket and GitHub that you can add to Git.\n\n- `browse` - Opens a browser for the current repository and branch.\n- `pull-request` - Opens a new pull-request.\n- `quick-start` - Quickly starts a new project by copying and customizing an existing repository.\n\nTo add these commands to Git, do `git config --global --edit` and insert:\n\n```sh\n[alias]\n  ...\n  browse = !git-extra browse\n  pull-request = !git-extra pull-request\n  quick-start = !git-extra quick-start\n```\n\n## Quick Start\n\nBy default `quick-start` copies an existing repository by cloning it and then resets the Git history.\n\nThe power of `quick-start` is that you can customize the project after the initial clone.  To enable this, create a `git-extra-customize.js` file in the root of the project.  This file contains a Javascript program that is run after the initial clone which can change the contents of the files, changing names, creating files and directories, etc..  The script is run in a VM so it can only do a restricted set of things.  See the [GitExtraTool.js](./src/GitExtraTool.js) for the full list of functions available.\n\n### `git-extra-customize.js`\n\nThe following objects and methods are available:\n\n| `async` | Method                               | Description                                                                 |\n| ------- | ------------------------------------ | --------------------------------------------------------------------------- |\n|         | `args.projectName`                   | The name of the project (the `path.basename()` of the directory)            |\n|         | `args.userName`                      | The name of the currently logged in user                                    |\n|         | `ui.log(message)`                    | Display a message to stdout                                                 |\n| `async` | `fs.readFile(fileName)`              | Read a file from the project                                                |\n| `async` | `fs.writeFile(fileName)`             | Write a file to the project                                                 |\n| `async` | `fs.remove(pathName)`                | Remove a file or directory from the project                                 |\n| `async` | `fs.move(fromPath, toPath)`          | Move a file or directory in the project                                     |\n| `async` | `fs.ensureFile(fileName)`            | Ensure a file exists in the project, creating it if not                     |\n| `async` | `fs.ensureDir(dirName)`              | Ensure a directory exists in the project, creating it if not                |\n| `async` | `fs.inPlaceUpdate(fileName, array)`  | In-place-update a file with an array of search/replace strings. See below.  |\n|         | `path.join(...pathNames)`            | Join a bunch of path parts                                                  |\n|         | `path.dirname(pathName)`             | Get the directory part of a path                                            |\n|         | `path.basename(pathName[, extName])` | Get the base part of path with any extension, remove `extName` if it exists |\n|         | `path.extname(pathName)`             | Get the extension of a path                                                 |\n| `async` | `git.forceAdd(fileName)`             | Force add a file to the Git repository                                      |\n|         | `changeCase.camel(name)`             | Change the name to \"camelCase\"                                              |\n|         | `changeCase.capital(name)`           | Change the name to \"Capital Case\"                                           |\n|         | `changeCase.constant(name)`          | Change the name to \"CONSTANT_CASE\"                                          |\n|         | `changeCase.dot(name)`               | Change the name to \"dot.case\"                                               |\n|         | `changeCase.header(name)`            | Change the name to \"Header-Case\"                                            |\n|         | `changeCase.word(name)`              | Change the name to \"word case\"                                              |\n|         | `changeCase.param(name)`             | Change the name to \"param-case\"                                             |\n|         | `changeCase.pascal(name)`            | Change the name to \"PascalCase\"                                             |\n|         | `changeCase.path(name)`              | Change the name to \"path/case\"                                              |\n|         | `changeCase.sentence(name)`          | Change the name to \"Sentence case\"                                          |\n|         | `changeCase.snake(name)`             | Change the name to \"snake_case\"                                             |\n| `async` | `ui.prompts(promptArray)`            | Display array of prompts. See below.                                        |\n|         | `ui.log(message)`                    | Display a message to stdout                                                 |\n\n`ui.prompts(...)` takes an array of:\n\n```js\n  [\n    {\n      name: string,\n      initial: string, // Optional\n      message: string,\n      regex: string, // Optional\n      error: string, // Optional\n    }\n  ]\n```\n\n`fs.inPlaceUpdate(...)` takes an array of arrays of search/replace pairs:\n\n```js\n [\n   [/something/, \"anotherThing\"],\n ]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjlyonsmith%2Fgit-extra","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjlyonsmith%2Fgit-extra","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjlyonsmith%2Fgit-extra/lists"}