{"id":20852569,"url":"https://github.com/vpayno/git-helpers","last_synced_at":"2025-10-18T03:52:02.334Z","repository":{"id":219869841,"uuid":"749653862","full_name":"vpayno/git-helpers","owner":"vpayno","description":"Git Commit Helpers","archived":false,"fork":false,"pushed_at":"2024-08-04T03:39:57.000Z","size":258,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-19T06:26:19.978Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","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/vpayno.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-29T05:51:31.000Z","updated_at":"2024-12-30T22:29:05.000Z","dependencies_parsed_at":"2024-03-23T16:31:35.913Z","dependency_job_id":"fbaace76-9c90-4cf0-ad56-24d099c511d0","html_url":"https://github.com/vpayno/git-helpers","commit_stats":null,"previous_names":["vpayno/git-commit-helper"],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vpayno%2Fgit-helpers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vpayno%2Fgit-helpers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vpayno%2Fgit-helpers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vpayno%2Fgit-helpers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vpayno","download_url":"https://codeload.github.com/vpayno/git-helpers/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243222188,"owners_count":20256229,"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":["bash","git","gum"],"created_at":"2024-11-18T03:18:05.980Z","updated_at":"2025-10-18T03:52:02.254Z","avatar_url":"https://github.com/vpayno.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# git-helpers\n\nStarting out with a demo for a git-commit-helper using bash and Gum and seeing where this eventually ends up.\n\n## Iterations\n\nJust finished [Effortless](https://gregmckeown.com/books/effortless/) and I'm trying it out for this project.\n\n- v1 - it's ugly but it's at least written down/created\n\n    - Go through my ~/.gitconfig files and manual command clumps and create v1 versions of them first.\n    - Only working on one script at a time.\n    - Mostly only using [Bash](https://www.gnu.org/software/bash/manual/bash.html), [Gum](https://github.com/charmbracelet/gum) and [Glow](https://github.com/charmbracelet/glow)\n    - Adding headless modes to some of the scripts.\n\n- v2 - improve them without burning out, over effort, or maximizing diminishing returns\n\n    - Use these as practice for learning Go+Cue+BubbleTea.\n    - Slow is smooth, smooth is fast.\n\n## Setup\n\nTo install the git helpers and project dependencies run the following commands:\n\n```bash { background=false category=setup closeTerminalOnSuccess=true excludeFromRunAll=true interactive=true interpreter=bash name=setup-git-helpers promptEnv=true terminalRows=10 }\nset -e\n\nif [[ ! -d ~/.git-helpers ]]; then\n    git clone https://github.com/vpayno/git-helpers.git ~/.git-helpers\nfi\n\ncd ~/.git-helpers\n./install-deps.sh\n./install-git-aliases.sh\n```\n\nUse this runme playbook step to refresh the ~/.git-helpers installation.\n\n```bash { background=false category=refresh closeTerminalOnSuccess=true excludeFromRunAll=true interactive=true interpreter=bash name=refresh-git-helpers promptEnv=true terminalRows=10 }\n./refresh-checkout.sh\n```\n\n### Dependencies\n\nNote: you can use [RunMe](https://github.com/stateful/runme) to use this readme as a playbook.\n\nTo install all the dependencies at once you can use the included installation script:\n\n```bash { background=false category=setup closeTerminalOnSuccess=true excludeFromRunAll=false interactive=true interpreter=bash name=install-dep-all promptEnv=true terminalRows=10 }\n./install-deps.sh\n```\n\n- [Gum](https://github.com/charmbracelet/gum)\n\n```bash { background=false category=dependency closeTerminalOnSuccess=true excludeFromRunAll=true interactive=true interpreter=bash name=install-dep-gum promptEnv=true terminalRows=10 }\ngo install github.com/charmbracelet/gum@latest\n```\n\n- [Glow](https://github.com/charmbracelet/glow)\n\n```bash { background=false category=dependency closeTerminalOnSuccess=true excludeFromRunAll=true interactive=true interpreter=bash name=install-dep-glow promptEnv=true terminalRows=10 }\ngo install github.com/charmbracelet/glow@latest\n```\n\n- [Confetty](https://github.com/maaslalani/confetty)\n\n```bash { background=false category=dependency closeTerminalOnSuccess=true excludeFromRunAll=true interactive=true interpreter=bash name=install-dep-confetty promptEnv=true terminalRows=10 }\ngo install github.com/maaslalani/confetty@latest\n```\n\n- [GitHub Cli](https://github.com/cli/cli)\n\n```bash { background=false category=dependency closeTerminalOnSuccess=true excludeFromRunAll=true interactive=true interpreter=bash name=install-dep-github-cli promptEnv=true terminalRows=10 }\ngo install github.com/cli/cli/v2/cmd/gh@latest\n```\n\n- [GitLab Cli](https://gitlab.com/gitlab-org/cli)\n\n```bash { background=false category=dependency closeTerminalOnSuccess=true excludeFromRunAll=true interactive=true interpreter=bash name=install-dep-gitlab-cli promptEnv=true terminalRows=10 }\ngo install gitlab.com/gitlab-org/cli/cmd/glab@latest\n```\n\n## Releases\n\nThe `./tag-release` script is used to\n\n- update the [CHANGELOG](./CHANGELOG.md)\n- create an annotated tag\n- create a GitHub and/or GitLab release\n\nUse this Runme playbook to list the latest 10 releases:\n\n```bash { background=false category=release closeTerminalOnSuccess=true excludeFromRunAll=true interactive=true interpreter=bash name=releases-list promptEnv=true terminalRows=10 }\nstty rows 25\nstty cols 90\n\nprintf \"\\n\"\nprintf \"Latest local releases:\\n\"\nprintf \"\\n\"\ngit tag --list -n1 | tail -n 10\nprintf \"\\n\"\n\nif git remote -v | grep -q -E \"^origin\\b.*@github\\.\"; then\n    printf \"Latest GitHub Releases:\\n\"\n    printf \"\\n\"\n    gh release list --limit 10\n    printf \"\\n\"\nfi\n\nif git remote -v | grep -q -E \"^origin\\b.*@gitlab\\.\"; then\n    printf \"Latest GitLab Releases:\\n\"\n    printf \"\\n\"\n    glab release list --page 1 --per-page 10\n    printf \"\\n\"\nfi\n```\n\nUse this Runme playbook to list the unreleased commits:\n\n```bash { background=false category=release closeTerminalOnSuccess=true excludeFromRunAll=true interactive=true interpreter=bash name=releases-unreleased-commits promptEnv=true terminalRows=10 }\nprintf \"\\n\"\nprintf \"Unreleased commits since %s:\\n\" \"$(git tag --list -n0 | tail -n1)\"\nprintf \"\\n\"\ngit log --pretty=format:'%h -%d %s (%cr) \u003c%an\u003e' --abbrev-commit --decorate \"$(git tag --list -n0 | tail -n1)\"..\nprintf \"\\n\"\n```\n\nUse this Runme playbook to tag a new release.\n\n```bash { background=false category=release closeTerminalOnSuccess=true excludeFromRunAll=true interactive=true interpreter=bash name=release-create promptEnv=true terminalRows=20 }\nexport TAG_TITLE=\"short description\"\n\nreset\n./tag-release \"${TAG_TITLE}\"\n```\n\n## Helpers\n\nInstall or refresh git aliases for the helpers.\n\n```bash { background=false category=refresh,git closeTerminalOnSuccess=true excludeFromRunAll=false interactive=true interpreter=bash name=install-git-helpers promptEnv=true terminalRows=10 }\n./install-git-aliases.sh\n```\n\n### git-commit-helper\n\nNot a dumb tool, it helps:\n\n- remind you of the proper format for commit subjects,\n- spell check your subject and body and\n- lint unpushed commit(s) or the task branch.\n\n### git-fixup-helper\n\nThis one makes using fixup commits easier.\n\nAs I add scripts, they are successfully better than the last.\n\n- Checks to see if the user has staged changes.\n- Has different behavior if on the default branch or a task branch.\n- Has a roundabout way of browsing commit fixup candidates.\n- Guides user on next steps.\n\n### git-new-branch-helper\n\nThis script creates a new worktree and branch and then shows you how to clean up after you're done with your change review.\n\nNote: Using `cr` for `change-review` instead of `pr` for `pull-request` or `mr` for `merge-request`.\n\n- worktree path layout \"repo root path\"-cr-\"branch name\"\n- only allows alpha-numeric characters, dash and underscore in branch names\n    - spaces, /, etc can create a lot of headaches\n- show users how to start using their new branch and worktree\n- show users how to remove their new worktree and branch (that will get replaced by the next helper)\n\n### git-delete-branch-helper\n\nThis scripts automates the deletion of branches, and associated worktrees, from a local and remotes.\n\nInstead of over complicating the script, assume it will wipe the branch from existence (except for the reflog).\n\nIf you need to perform a surgical deletion of the branch, do it by hand.\n\n- prompt for \"enter name\" or \"search for branch\"\n- confirm the branch name by showing the last 10 commits in the branch\n- check if a worktree is associated with the branch\n- delete both the worktree and branch from local\n- delete the branch from all remotes\n- declare victory over the evil Branchians, maybe use that terminal fireworks CLI\n\n### git-clean-up-branches-helper\n\nAlmost the same as `git-delete-branch-helper`.\nThe difference is that the user starts with all the merged branches selected and all the not-merged branches are omitted from the selection screen.\n\n- Supports headless mode so it can be run from git.\n\n### git-fetch-cr-helper\n\nUsed to simplify the process of checking out a change review (CR) branch from GitHub/GitLab.\n\n- Uses git worktrees.\n- Checks out change review to immutable branch `prs-number` (GitHub) or `mrs-number` (GitLab).\n- If both GitHub and GitLab push URLs are found for the `origin` remote, check GitHub first, then Gitlab.\n- Uses [gh](https://github.com/cli/cli) and [glab](https://gitlab.com/gitlab-org/cli) clis.\n- Creates worktree with the same branch name as the one used in the change review.\n- Adds remote (when the change review author used a fork) that can be tracked and pushed to.\n- Reminds users to use `git-fixup-helper` when modifying existing commits to make it easier to show/review changes by the change review author..\n\n### git-master-to-main-migration-helper\n\nI hate it when someone renames the `master` branch to `main` without taking care that other developers don't just re-push the `master` branch and keep working with it.\n\nThis helper helps with that problem. It's a lot of steps to run by hand over and over again so this is a perfect task for automation.\n\n- clone `master` to `main`\n- update the default branch on github and/or gitlab\n- make sure force pushes are blocked on `main`\n- reset commit history on `master` to 1 commit\n    - add new readme with info on the rename and instructions they should run on their local clone\n    - amend and reword the only commit\n    - goal is to make it very obvious they need to stop using `master` and to start using `main`\n    - force push `master`\n    - block force pushes on `master` upstream(s)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvpayno%2Fgit-helpers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvpayno%2Fgit-helpers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvpayno%2Fgit-helpers/lists"}