Skip to main content

githelp

A tiny git helper published as githelp. It installs four commands: gg, ggi, ggc, and ggcr.

pip install githelp

gg — commit without quotes

Type your message straight after gg, no quotes:

gg fix the login bug and update the readme

That runs, in order:

git add .
git commit -m "fix the login bug and update the readme"
git push

It warns you and asks "are you sure?" before committing when:

  • more than 100 files are staged, or
  • more than 100,000 changed lines are staged.

If you decline, it aborts (your files stay staged). If neither threshold is crossed, it just commits and pushes. If the current branch has no upstream, it pushes with --set-upstream origin <branch> automatically.

gg --help     # usage

ggi — add a .gitignore template

Templates are fetched live from github/gitignore through the GitHub API, so they are always the current upstream versions (nothing is bundled or stale).

ggi            # interactive: type to fuzzy-search the full list, then pick one
ggi Python     # add a named template directly
ggi --help     # usage

The selected template is appended to your repository's .gitignore inside a clearly marked block, so it is easy to find and is never added twice.

Tip: set GITHUB_TOKEN (or GH_TOKEN) in your environment to avoid GitHub's unauthenticated API rate limit.

ggc — clone a repo and re-home it under your account/org

Mirror a public repo into your own GitHub account or org in one shot — clone, drop the old remote, create the new repo, wire up the https origin, and push.

ggc <github-url> <owner/repo>     # create under an org (or another user)
ggc <github-url> <repo>           # create under your own GitHub account
ggc https://github.com/someone/cool-lib leanmcp/cool-lib
ggc https://github.com/someone/cool-lib my-fork

That runs, in order:

git clone <github-url> <repo>
git -C <repo> remote remove origin
# if .github/workflows exists: drop it, re-home as one fresh commit
gh repo create <owner/repo> --private          # --public to make it public
git -C <repo> remote add origin https://github.com/<owner>/<repo>.git
git -C <repo> push --set-upstream origin <branch>

If the cloned repo has a .github/workflows/ folder, ggc deletes it and re-homes the clone as a single fresh commit (no workflows, no history). This keeps the new repo free of GitHub Actions and avoids GitHub's restriction that a push touching workflow files needs the gh token's workflow scope — no commit being pushed contains a workflow file, so no extra scope is required. Repos with no workflows folder keep their full history untouched.

New repos are private by default; pass --public to make them public. When you give just <repo> (no owner), it creates it under your own account using your authenticated GitHub username. The origin is always wired with the https URL, never ssh.

ggc --help     # usage

Requires the GitHub CLI (gh), authenticated via gh auth login.

ggcr — create a GitHub repo for the folder you are in

Turn the folder you are standing in into a GitHub repo: create it, wire up the https origin, set upstream, and push — one command.

ggcr                    # repo named after this folder, under your own account
ggcr <repo>             # name it yourself, under your own account
ggcr <owner/repo>       # create it under an org (or another user)
ggcr
ggcr my-new-thing --public
ggcr leanmcp/my-new-thing

That runs, in order:

git init                                      # only if this is not a repo yet
git add . && git commit -m "Initial commit"   # only if there are no commits yet
gh repo create <owner/repo> --private         # --public to make it public
git remote add origin https://github.com/<owner>/<repo>.git
git push --set-upstream origin <branch>

With no arguments the repo is named after the repository root folder. New repos are private by default; pass --public to make them public. If origin is already set, ggcr shows you the current URL and asks before replacing it.

ggcr --help    # usage

Also requires gh, authenticated via gh auth login.


Install from source / develop

git clone https://github.com/rosaboyle/githelp
cd githelp
pip install -e .

Dependencies

Pinned to the latest releases:

Package Version
httpx 0.28.1
questionary 2.1.1
rich 15.0.0

Requires Python 3.9+.


Publishing

A helper script is provided: publish.sh.

./publish.sh            # build + upload to PyPI
./publish.sh --test     # upload to TestPyPI instead
./publish.sh --check    # build only, validate with twine, do not upload

Manual equivalent:

python -m pip install --upgrade build twine
python -m build
twine check dist/*
twine upload dist/*

Authenticate to PyPI with an API token: create one at https://pypi.org/manage/account/token/ and either set TWINE_USERNAME=__token__ and TWINE_PASSWORD=<your-token>, or let twine prompt you.

License

MIT — see LICENSE.

Metadata

Release files for githelp 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for githelp 0.3.0
File Size Uploaded
githelp-0.3.0.tar.gz 12.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for githelp 0.3.0
File Interpreter ABI Platform
githelp-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 23.6 kB

Release files / githelp-0.3.0.tar.gz

Download URL githelp-0.3.0.tar.gz
Size 12.6 kB
Tags Source
SHA-256 checksum
How to use checksums
07c8962dd0d0b5628b919d6e557e4085f3fafefd4bc0d692e3cfb3812a52877a
BLAKE2b-256 checksum
How to use checksums
d1f8923dbc12e0fb552e242ba99a16a48bf7d7b23c1dc5e2da309720d7cf061a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.4

Release files / githelp-0.3.0-py3-none-any.whl

Download URL githelp-0.3.0-py3-none-any.whl
Size 11.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e73d8da2f1436c64db2e44eeb1465a33c81fa2e33c1d97dc87771252076dcfa9
BLAKE2b-256 checksum
How to use checksums
27c1255b133da427acd98ef884d346c4743f3f73cb6272c9c4c8f9dedfc10730
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.4

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page