Skip to main content

Fetch collections of git projects

Project description

Fetch collections of git projects

Version on pypi Tested with Github Actions Test code codecov Python versions tested

Overview

With mgit, you can pull/fetch several projects at once, and also auto-cleanup dangling branches (from past pull requests).

A colored output is provided if possible, mgit should come in handy in general for:

  • quickly getting an overview of what’s up with N git projects

  • fetch/pull N git objects at once

  • clone missing projects (useful if you tend to clone projects from same remote in one common folder)

Example usage

mgit can show you what’s the status of all your git projects in a folder, for example my repos:

~/dev/github: mgit
~/dev/github: 4 github/zsimic
     mgit: [master] up to date
  pickley: [master] 1 diff, up to date*  last fetch 1w 4d ago
    runez: [master] up to date*  last fetch 1w 4d ago
setupmeta: [master] up to date*  last fetch 3d 23h ago

Here we can see that:

  • There are 4 git repos in folder ~/dev/github

  • All 4 come from github/zsimic

  • 3 of them haven’t been fetched in a while

We can fetch them all at once with --fetch (or -f):

~/dev/github: mgit --fetch
~/dev/github: 4 github/zsimic
     mgit: [master] up to date
  pickley: [master] 1 diff, up to date
    runez: [master] behind 2
setupmeta: [master] up to date

Now all projects have been refreshed, and we can see there’s nothing new in 2 of them, but one is 2 commits behind (ie: 2 commits are on the remote, not pulled yet). The output also shows that one of the projects has uncommitted files.

Modified files are shown (by default) if only one project is in scope, for example:

~/dev/github: mgit pickley
pickley: [master] 1 diff, up to date
   M tox.ini

Above, we can see that the modified file in question is tox.ini in that project. We can get the same effect using the --verbose (or -v) flag, like for example with 2 projects with modified files:

~/dev/github: mgit -v
~/dev/github: 4 github/zsimic
mgit: [master] 1 diff, up to date
   M README.rst
pickley: [master] 1 diff, up to date
   M tox.ini
runez: [master] up to date
setupmeta: [master] up to date

Synopsis:

~/dev/github: mgit --help
Usage: mgit [OPTIONS] [TARGET]

  Fetch collections of git projects

Options:
  --version                       Show the version and exit.
  --debug                         Show debugging information.
  --color / --no-color            Use colors (on by default on ttys)
  --log PATH                      Override log file location.
  --clean [show|local|remote|all|reset]
                                  Auto-clean branches
  -f, --fetch                     Fetch from all remotes
  -p, --pull                      Pull from tracking remote
  -s, --short / -v, --verbose     Short/verbose output
  -cs                             Handy shortcut for '--clean show'
  -cl                             Handy shortcut for '--clean local'
  -cr                             Handy shortcut for '--clean remote'
  -ca                             Handy shortcut for '--clean all'
  -h, --help                      Show this message and exit.

Installation

Easiest way to get mgit is via pickley or pipx:

pickley install mgit

or:

pipx install mgit

You can also compile from source:

git clone https://github.com/zsimic/mgit.git
cd mgit
tox -e venv

.venv/bin/mgit --help

source .venv/bin/activate
mgit --help

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

mgit-1.3.0.tar.gz (17.0 kB view details)

Uploaded Source

Built Distribution

mgit-1.3.0-py2.py3-none-any.whl (16.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file mgit-1.3.0.tar.gz.

File metadata

  • Download URL: mgit-1.3.0.tar.gz
  • Upload date:
  • Size: 17.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for mgit-1.3.0.tar.gz
Algorithm Hash digest
SHA256 1a881aec13df16a749e8f600d735924e21f45273666424aa426c0546172fbc9d
MD5 0b28b540216f716a29a25c9a10ab6eb0
BLAKE2b-256 cd848fa5a35a3838e086f68d11c0e8ff2729fa72cdfa4bae5c862dae1d366f73

See more details on using hashes here.

File details

Details for the file mgit-1.3.0-py2.py3-none-any.whl.

File metadata

  • Download URL: mgit-1.3.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 16.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for mgit-1.3.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 00d9ce4334989fd148890f9ceae8d5de8d3e0eef87f98f47b950d2a53869e20a
MD5 75abfb2ac4c5e9c84b3f025968e5e16c
BLAKE2b-256 14089f6767c4035e225a19af046ff8d8c3b88c03f4f548d689c0940ace1670ac

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