Skip to main content

Manage git projects en masse

Project description

Manage git projects en masse

Version on pypi Travis CI codecov Python versions tested (link to github project)

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 3w 4d ago
    runez: [master] up to date*  last fetch 3w 4d ago
setupmeta: [master] up to date*  last fetch 4d 23h ago

Here we can see that I have 4 repos in ~/dev/github (and 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] up to date
setupmeta: [master] up to date

Now all projects have been refreshed, and we can see there’s nothing new (otherwise we’d see a mention of the form 2 commits behind). The output also shows that one of the projects has uncommitted files.

Modified files are shown 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]

  Manage git projects en masse

Options:
  --version                       Show the version and exit.
  --debug                         Show debugging information
  --color / --no-color            Use (or not) colors (on by default on tty)
  --ignore action[:what]          Show/add/remove/clear ignores
  --clean [show|local|remote|all|reset]
                                  Auto-clean branches
  -a, --all                       Examine all repos, even missing git checkouts
  -f, --fetch                     Fetch from all remotes
  -p, --pull                      Pull from tracking remote, clone missing with --all
  -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.

  Advanced usage:
    --clean show                  Show which local/remote branches can be cleaned
    --clean local                 Clean local branches that were deleted from their corresponding remote
    --clean remote                Clean merged remote branches
    --clean all                   Clean local and merged remote branches
    --clean reset                 Do a git --reset --hard + clean -fdx (nuke all changes, get back to pristine state)

    --ignore show                 Show ignores currently in effect
    --ignore add 'hackday.*'      Add an ignore regex, for example here 'hackday.*'
    --ignore remove 'hackday.*'   Remove an ignore regex, for example here 'hackday.*'
    --ignore clean                Remove all ignores

Installation

Easiest way to get mgit is via pickley or pipsi:

pickley install mgit

pipsi install mgit

You can also compile from source:

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

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.0.3.tar.gz (21.6 kB view details)

Uploaded Source

Built Distribution

mgit-1.0.3-py2.py3-none-any.whl (23.7 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: mgit-1.0.3.tar.gz
  • Upload date:
  • Size: 21.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

File hashes

Hashes for mgit-1.0.3.tar.gz
Algorithm Hash digest
SHA256 39cc5763e9874ca568ef07be30d16f302d52b6edfde1e00c21e0fa2d116f0ea6
MD5 e8ea22cd4eeab6338332cc07faff6d7b
BLAKE2b-256 aa532e1a9a992be7cbbbdb5d480ce78b533ff05850ccb03a05d7db16be174254

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mgit-1.0.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 23.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

File hashes

Hashes for mgit-1.0.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0148b438a671bd3df18b6e1dc9dcdc66bb94101759aeb8632dc991f1d89ad2f5
MD5 7d65c2d78a359c74bbe19f1a6ff0419a
BLAKE2b-256 3f246c605041f61b7af69b41f5b76b20d6b8a8c5883f493f623212303b760df1

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