Skip to main content

githelp - a tiny git helper (gg/ggi/ggc): commit without quotes, add .gitignore templates from github/gitignore, and re-home a clone under your own GitHub account/org

Project description

githelp

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

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
# rm -rf .github/workflows && commit the removal (if present)
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 commits the removal, so the new repo has no GitHub Actions workflows. Because the upstream commit that added those workflows is still in the history being pushed, GitHub needs your gh token to carry the workflow scope — grant it once with:

gh auth refresh -h github.com -s workflow

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.


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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

githelp-0.1.3.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

githelp-0.1.3-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file githelp-0.1.3.tar.gz.

File metadata

  • Download URL: githelp-0.1.3.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for githelp-0.1.3.tar.gz
Algorithm Hash digest
SHA256 44b72966f794dd34f54cd01d68f3b4bd859aee8632b88c6274bba034051e7289
MD5 679bf3601098d0a283dab5f24a36e702
BLAKE2b-256 15b058cc0cc432093ed5a32dddc24098537a2487fb3acf5c5087ec78fdeb93d1

See more details on using hashes here.

File details

Details for the file githelp-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: githelp-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for githelp-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 409aa84a878a2be8a77214fe0965f11a04692bd25fd7ea86ac26ecb796ace88c
MD5 f7ee4d16b5252f88dfb3f2078f0560ef
BLAKE2b-256 eb3b56c63ceb3bb56dda5d60b9d8b4a759a48f37cf1ed17ba2e3fbe6bff72dcb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page