Skip to main content

A (tiny) Git utility for auto-committing and concurrent pushing

Project description

git pp

A (tiny) Git utility for auto-committing and concurrent pushing.

Powered by asyncio, with no dependency besides python>=3.10 and git.

Features

  • Auto-stages and commits with custom or generated commit messages
  • Pushes to multiple or all remotes of a git repository concurrently with asyncio
  • Operates on any number of git repositories at the same time

Demo

Asciicast

In this demo, git pp did the following in ~/config and ~/gui repos:

  • (Concurrently) Auto staged all changes and commits with ISO-8601 timestamps as commit messages;
  • (Concurrently) Pushed the changes in the checked out branch to all of their remotes, in this case, they’re origin and lab.

Use cases and example usage

  • You have multiple remotes registered on a local git repository (or more) and want to push the changes to all or some of the remotes fast and efficiently.
# Use --push-only or -po

$ git pp --push-only # this pushes to all remotes of the current git repository, does not stages or commits
$ git pp --push-only --remote [one or more remotes] # only pushes to the specified remotes
$ git pp -po --timeout 10 # terminates pushing to one remotes if it takes more than 10 seconds
$ git pp -po -b dev ~/my-proj ~/my-proj2 # pushes the dev branch to all remotes in ~/my-proj and ~/my-proj2 repository
  • You're tired of using git add --all && git commit every time you make a little change and want to automate this across one or more repositories.
$ git pp # stages all files in the current git repository and commits with a timestamp as the commit message
$ git pp -m 'Initial commit' # custom commit message
$ git pp --no-status # don't show git status and git add outputs

And you can do both of the above (auto-commit and push) with --push:

# Use --push or -p

$ git pp --push # stages, commits and pushes to all remotes.
$ git pp --push --remote [one or more remotes]
$ git pp -p --timeout 10
$ git pp -p -b dev ~/my-proj ~/my-proj2

Installation

First make sure the git executable is installed and in your $PATH.

Note that non-UNIX systems are not officially supported.

pipx

This is the recommended installation method.

$ pipx install git-pp

pip

$ pip install git-pp

AUR

For Archlinux.

$ yay -S python-git-pp

Usage

You can either invoke this tool with git-pp or git pp, --help is unsupported when using the latter.

$ git pp -h
usage: git pp [-h] [-m COMMIT_MESSAGE] [-v] [-so] [-p] [-po] [-r REMOTE [REMOTE ...]] [-b BRANCH] [-f] [-t TIMEOUT] [DIRS ...]

Git utility for auto-committing and concurrent pushing

positional arguments:
  DIRS                  Dirs to operate on (default: ['.'])

options:
  -h, --help            show this help message and exit
  -m COMMIT_MESSAGE, --commit-message COMMIT_MESSAGE
                        commit message (default: None)
  -v, --version         show program's version number and exit
  -so, --status-only    Prints status only (default: False)
  -p, --push            Push to all remotes (default: False)
  -po, --push-only      Push to all remotes, without pre_pull (default: False)
  -r REMOTE [REMOTE ...], --remote REMOTE [REMOTE ...]
                        Remote name (default: None)
  -b BRANCH, --branch BRANCH
                        Branch name (default: None)
  -f, --force           Force push (default: False)
  -t TIMEOUT, --timeout TIMEOUT
                        Timeout for a single push (default: None)

Develop

$ git clone https://github.com/tddschn/git-pp.git
$ cd git-pp
$ poetry install

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

git_pp-2.0.0.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

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

git_pp-2.0.0-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file git_pp-2.0.0.tar.gz.

File metadata

  • Download URL: git_pp-2.0.0.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.10 Darwin/24.4.0

File hashes

Hashes for git_pp-2.0.0.tar.gz
Algorithm Hash digest
SHA256 b0f810bcff0c4a10476d79a66f04427f4c8cdadb30cd8b27568f769a2416efda
MD5 04c6e365d316817df98863d0ef12fbe8
BLAKE2b-256 109843f1356faa681a03d4f27013db2810367e686077bdec23c40aadda57fe83

See more details on using hashes here.

File details

Details for the file git_pp-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: git_pp-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.10 Darwin/24.4.0

File hashes

Hashes for git_pp-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cceeb7e766ae783cccd533904b210df3e1701223da14eb28ed4b3db87ac2b6d9
MD5 f26b072a19070d62302ea2702a25b034
BLAKE2b-256 b7d1af0e865fdc6a8f5ad838212c275c689395a8faef3312295e2f35c2af9e65

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