Skip to main content

Multi repository git utility. Manage multiple git-repositories simultaneously.

Project description

mud

Version AUR Version Test projects integrity Publish Python Package Publish to AUR

Demo

mud is CLI utility that allows you to run git commands in multiple repositories. It has multiple powerful filtering tools, native commands with an informative terminal output and support of aliasing. This tool is not limited to git commands only; you can run any commands you wish. However, this tool was primarily designed to be used with git, so each referenced directory should have a .git directory.

Installing

PyPI

pip install mud-git

ArchLinux

paru -S mud-git

For requirements check requirements.txt.

Getting started

  1. Run mud config to start an interactive wizard that helps you set the preferred settings. Check the settings section for more details. At the end, a .mudsettings file will appear in your home directory, which you can modify in the future.
  2. Navigate to your preferred directory with repositories.
  3. Run the mud init command to create a .mudconfig file. This file is important for keeping references to repositories. All repositories in the current directory will be included in .mudconfig.
  4. Optional: Run mud set-global to make the current configuration default and accessible from any directory.

All entries are stored in .mudconfig in TSV format. After making your first entry, you can open .mudconfig in a text editor and modify it according to your needs.

Now you're able to run any command. Some examples:

# Fetch all repositories
mud git fetch
# Switching all repositories to a "master" branch
mud git checkout master
# Alternatively, you can filter only repos on non-master branch and switch them to master
mud --not-branch=master git checkout master
# Pull all diverged branches
mud --diverged git pull

Using

Commands

Command Description
mud set-global sets the current .mudconfig as a global configuration so it will be used as a fallback configuration to run from any directory.
mud get-config prints the current .mudconfig location.
mud prune removes all invalid repositories from the .mudconfig.
mud info/mud i displays branch divergence and working directory changes.
mud status/mud st displays working directory changes.
mud log/mud l displays the latest commit message, its time, and its author.
mud labels/mud lb displays mud labels across repositories.
mud branches/mud br displays all branches in repositories.
mud remote-branches/mud rbr displays all remote branches in repositories.
mud complete-branch prints unique current branch names across repositories for shell completion.
mud complete-branch-all prints unique local and remote branch names across repositories for shell completion.
mud tags/mud t displays git tags in repositories.

Flags

mud <FLAG> <COMMAND> will execute a bash command across all repositories.

Flag Description
-n=<str> or --name=<str> includes repositories that contains provided string.
-l=<label> or --label=<label> includes repositories with the provided label.
-L=<label> or --not-label=<label> excludes repositories with the provided label.
-b=<branch> or --branch=<branch> includes repositories with the provided branch.
-B=<branch> or --not-branch=<branch> excludes repositories with the provided branch.
-c or --command explicit command argument. Use this whenever you're trying to run a complex command.
-m or --modified filters out modified repositories.
-d or --diverged filters repositories with diverged branches.
-t or --table toggles the default table view setting for execution.
-a or --async toggles the asynchronous execution feature.

Example:

# Filters out all repos with the master branch and diverged branches and then runs the pull command.
mud -b=master -d git pull

# Fetches all repositories that are not on the master branch and have the "personal" label, excluding those with the "work" label.
mud -B=master -l=personal -L=work git fetch

Completion helpers:

# Menu for -b= and -B= suggestions
mud complete-branch

# Full unique branch menu suitable for commands like "mud to <branch>"
mud complete-branch-all

Settings

Settings are stored at ~/.config/mud/settings.ini.

Key Value Description
run_async True/False enables asynchronous commands.
run_table True/False enables table view for asynchronous commands. Requires run_async.
nerd_fonts True/False enables nerd fonts in the output.
display_borders True/False enables borders in the table view.
display_headers True/False enables headers in the table view.
display_absolute_paths True/False displays absolute paths for directories.
round_corners True/False enables round corners for the table view. Requires show_borders to be enabled.
collapse_paths True/False simplifies branch names in the branch view.
config_path ~/Documents/.mudconfig this is set by the mud set-global command.

Aliases

You can create your own aliases. To do so, edit the [alias] section of the .mudsettings file. The .mudsettings file has the following aliases by default:

[alias]
to = git checkout
fetch = git fetch
pull = git pull
push = git push

Labeling

You can modify your .mudconfig file using the following commands:

Command Description
mud add <path> adds a path without a label.
mud add <path> <label> adds a path with an optional label.
mud remove <path> removes the directory with the specified path.
mud remove <path> <label> removes the label from a directory.

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

mud_git-1.1.5.tar.gz (260.7 kB view details)

Uploaded Source

Built Distribution

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

mud_git-1.1.5-py3-none-any.whl (20.2 kB view details)

Uploaded Python 3

File details

Details for the file mud_git-1.1.5.tar.gz.

File metadata

  • Download URL: mud_git-1.1.5.tar.gz
  • Upload date:
  • Size: 260.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for mud_git-1.1.5.tar.gz
Algorithm Hash digest
SHA256 2adb5d81d4859e3b93be17257c5cb988b474169e4e426db4d3a529cf53b830ee
MD5 9d1475bc9b964ab5c38dbf511bf81710
BLAKE2b-256 9c1c4e3adf2d589b08ca09aa671f1decfe1438a3a0bfd46855503b03696c6e3e

See more details on using hashes here.

File details

Details for the file mud_git-1.1.5-py3-none-any.whl.

File metadata

  • Download URL: mud_git-1.1.5-py3-none-any.whl
  • Upload date:
  • Size: 20.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for mud_git-1.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 412fd0ffef6dd6fd6197246ee5bf3352df4230e3abe01310ed244127ba7ea311
MD5 2cdced2db136d0338b7fe446b39e62f9
BLAKE2b-256 499f8d7186dde804322f7437bfaa1cdc0e75dfa3320dbe23629e576c2e42791d

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