Skip to main content

Command-line tool for fast git usage

Project description

Gutsy Git

Makes git usage extremely fast by making some gutsy assumptions.

Assumptions:

You work in a development environment based on pull request, avoiding pushing to your main branch. Commit messages are not always very relevant due to squashing. Your .gitignore is set up well enough to routinely add all changes.

Installation

pip install gutsygit

Usage

gg <any number of single letter commands> [<arguments>]

Commands:

  • b [<name>]: Create a new branch from origin/main with generated or given name, stashing and applying uncommitted changes if needed.
    • If the branch exists, adds a numeric suffix to the name.
  • s <name>: Switch to existing branch.
  • c [<*message>]: Commit changes.
    • Ensures you are not on your protected branches by creating a branch if needed.
    • Add all changes, including untracked files, and commit them with a generated or given commit message.
    • If a b or s command remains after, argument(s) are assumed to be for the branch name, and the message is always generated.
    • Retries once on failure to automatically commit changes resulting from pre-commit hooks.
  • C [<*message>]: Same as c, but bypasses pre-commit hooks on the second try using --no-verify.
  • p: Push commits.
    • Potentially pulls from remote if needed.
    • Sets tracking for the remote branch with the same name on the first push.
    • Opens a web browser if an url is returned by git, as GitHub does for pull requests.
  • l: Pull

Examples

  • gg cp: Commit and push changes with a generated commit message.
  • gg bcp newbranch some description: Create a new branch named "newbranch", commit, and push any changes that were not committed before this with the commit message "some description".
  • gg Csl othertask: Commit current changes regardless of commit hooks status, switch to 'othertask' branch and updates it.

Settings

Settings are retrieved from git config with the gutsygit.[setting] key:

Setting Default value Explanation
protectedbranches "main,master" comma-separated list of branch names to avoid pushing to. Also used to branch from for a new clean branch, taking the first entry found that exists in the remote.
openbrowser "1" open any urls returned from git push in a web browser
outputlevel "0" verbosity level (-1: debug, 1: headers/warnings/errors only)

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

gutsygit-0.5.2.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

gutsygit-0.5.2-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file gutsygit-0.5.2.tar.gz.

File metadata

  • Download URL: gutsygit-0.5.2.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.10

File hashes

Hashes for gutsygit-0.5.2.tar.gz
Algorithm Hash digest
SHA256 f4e8e913e9355f8fad07ee3c31da73c03c330c11216d0c13deaa98a5d71cfa62
MD5 ca54c0a43de0d1b481a5d5e85714b316
BLAKE2b-256 7a34c3b5b583033f479b9360f99a696966b156660fcafce63b4221cb4304b5b6

See more details on using hashes here.

File details

Details for the file gutsygit-0.5.2-py3-none-any.whl.

File metadata

  • Download URL: gutsygit-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.10

File hashes

Hashes for gutsygit-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 108b60e0d1b878944591577332b352a1798dfd2b6a46959e6c42b9b089a8a22b
MD5 245b8267bd7aca22f536bd6e438ff385
BLAKE2b-256 25481a8ce8b831efaa4d7865ee59752b6788e70b1663e8c232b84077401dbb19

See more details on using hashes here.

Supported by

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