{"id":21466542,"url":"https://github.com/permafrost-dev/git-ninja","last_synced_at":"2025-07-23T13:10:36.776Z","repository":{"id":262071918,"uuid":"717478201","full_name":"permafrost-dev/git-ninja","owner":"permafrost-dev","description":"Advanced git commands for developers","archived":false,"fork":false,"pushed_at":"2024-11-19T02:23:42.000Z","size":332,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-19T03:24:28.801Z","etag":null,"topics":["cli","developer-tools","git","git-commands"],"latest_commit_sha":null,"homepage":"","language":"Go","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/permafrost-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"permafrost-dev"}},"created_at":"2023-11-11T15:42:23.000Z","updated_at":"2024-11-19T02:22:59.000Z","dependencies_parsed_at":"2024-11-10T11:19:36.478Z","dependency_job_id":"2b3d3b95-ace9-49ec-a1d1-0f2b89143a42","html_url":"https://github.com/permafrost-dev/git-ninja","commit_stats":null,"previous_names":["permafrost-dev/git-ninja"],"tags_count":1,"template":false,"template_full_name":"permafrost-dev/go-project-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/permafrost-dev%2Fgit-ninja","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/permafrost-dev%2Fgit-ninja/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/permafrost-dev%2Fgit-ninja/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/permafrost-dev%2Fgit-ninja/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/permafrost-dev","download_url":"https://codeload.github.com/permafrost-dev/git-ninja/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226017177,"owners_count":17560466,"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":["cli","developer-tools","git","git-commands"],"created_at":"2024-11-23T08:14:25.213Z","updated_at":"2024-11-23T08:14:25.812Z","avatar_url":"https://github.com/permafrost-dev.png","language":"Go","funding_links":["https://github.com/sponsors/permafrost-dev"],"categories":[],"sub_categories":[],"readme":"# git-ninja\n\n---\n\n\u003c!-- [![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](https://choosealicense.com/licenses/mit/) --\u003e\n![MIT License](https://img.shields.io/badge/oss_license-MIT-blue?style=flat-square\u0026logo=opensourceinitiative\u0026logoColor=white)\n![GitHub Release](https://img.shields.io/github/v/release/permafrost-dev/git-ninja?include_prereleases\u0026sort=semver\u0026display_name=tag\u0026style=flat-square\u0026logo=github\u0026color=F9DC3E)\n![GitHub Release Date](https://img.shields.io/github/release-date/permafrost-dev/git-ninja?display_date=published_at\u0026style=flat-square\u0026logo=github)\n![Code Climate maintainability](https://img.shields.io/codeclimate/maintainability/permafrost-dev/git-ninja?style=flat-square\u0026logo=codeclimate)\n\nA powerful command-line tool designed to enhance your Git workflow with advanced commands tailored for developers. \nIt simplifies complex Git operations, making branch management and navigation more efficient and intuitive.\n\n## Screenshots\n\nRecently used branches:\n![image](https://github.com/user-attachments/assets/31142cc5-1f1c-4f07-bc9c-2b50f6701b43)\n\nFrequently used branches:\n![image](https://github.com/user-attachments/assets/8f3ddea1-24c4-41cc-93db-1f3e938b5dec)\n\n## Available Commands\n\n- `branch:current` - Work with the current branch\n- `branch:exists` - Check if the specified branch name exists\n- `branch:freq` - List branches frequently checked out\n- `branch:last` - Work with the last checked out branch\n- `branch:recent` - List branches recently checked out\n- `branch:search` - Search branch names for a substring or regex match\n- `checkout` - Check out a branch\n\n## Examples\n\nCheck out, then `git pull` the `main` branch:\n\n```bash\ngit-ninja checkout main --pull\ngit-ninja co main -p\n```\n\nList recently checked out branches:\n\n```bash\ngit-ninja branch:recent\n```\n\nList recently checked out branches, limit to 5 results and exclude 'develop' and 'main' from the list:\n\n```bash\ngit-ninja branch:recent -c 5 -e 'develop|main'\n```\n\nShow the last checked out branch name:\n\n```bash\ngit-ninja branch:last\n```\n\nSwitch to the last checked out branch:\n\n```bash\ngit checkout main\ngit checkout feature/my-feature\n\n# switch from feature/my-feature to main:\ngit-ninja branch:last --checkout \n```\n\nSearch for branches containing \"fix\":\n\n```bash\ngit-ninja branch:search fix\n```\n\nSearch for branches matching a regex pattern (e.g., all branches starting with `GN-12`):\n\n```bash\ngit-ninja branch:search -r \"GN-12.+\"\n```\n\nSearch for a substring in branch names, and check out the first result:\n\n```bash\ngit checkout main\ngit-ninja branch:search some-fix -o\n# our active branch is now \"feature/some-fix\" (assuming that was the first result)\n```\n\n### Git Aliases - Configuration\n\nAdd the following aliases to your `.gitconfig` file to use `git-ninja` commands as Git aliases:\n\n```ini\n[alias]\n    co = \"!f() { git-ninja checkout $@; }; f\"\n    # list recently checked out branches\n    lrb = \"!f() { git-ninja branch:recent $@; }; f\"\n    # list frequently checked out branches\n    lfb = \"!f() { git-ninja branch:freq $@; }; f\"\n    # search branches\n    sb = \"!f() { git-ninja branch:search $@; }; f\"\n    # push current branch\n    pcb = \"!f() { git-ninja branch:current --push; }; f\"\n    # switch to the last checked out branch\n    co-last = \"!f() { git-ninja branch:last --checkout; }; f\"\n```\n\n### Git Aliases - Examples\n\nList recently checked out branches:\n\n```bash\ngit lrb\n```\n\nSearch branch names:\n\n```bash\n# find branches containing \"fix\"\ngit sb fix\n# find branches matching a regex pattern\ngit sb -r \"fix.+\"\n# find branches containing \"fix\" and check out the first result\ngit sb fix -o\n# or checkout a branch by ticket number:\ngit sb -o 1123 # checks out 'GN-1123-my-feature-branch'\n```\n\nSwitch to the last checked out branch:\n\n```bash\ngit checkout main\ngit checkout feature/my-feature\ngit co-last # switch from feature/my-feature to main\n```\n\n## JIRA Integration\n\nThe `branch:recent` command can be run with the `--jira` flag to slightly modify the ordering of the results based on open issues in JIRA. Assuming your branches contain\nthe JIRA issue key in the branch name, the command will rank branches with open issues that have been updated recently slightly higher in the list.\n\nTickets with a higher numerical suffix and have been recently updated are ranked slightly higher in the list, \nwhile tickets that have not been updated recently are ranked lower.\n\n```bash\ngit-ninja branch:recent --jira\n```\n\nTo enable the JIRA integration, set the `JIRA_API_TOKEN`, `JIRA_SUBDOMAIN` and `JIRA_EMAIL_ADDRESS` environment variables.\n\n## Development Setup\n\n```bash\ngo mod tidy\n```\n\n### Building the project\n\n`git-ninja` uses the [task](https://github.com/go-task/task) build tool. To build the project, run the following command:\n\n```bash\ntask build\n```\n\n---\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.\n\n## Security Vulnerabilities\n\nPlease review [our security policy](../../security/policy) on how to report security vulnerabilities.\n\n## Credits\n\n- [Patrick Organ](https://github.com/patinthehat)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpermafrost-dev%2Fgit-ninja","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpermafrost-dev%2Fgit-ninja","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpermafrost-dev%2Fgit-ninja/lists"}