Skip to main content

Manages git repos within git repos.

Project description

Python Multigit

A Python version of the multigit Bash script.

While the multigit Bash script at simplest-git-subrepos was created for illustration purposes, this one is intended to be a full-fledged implementation.

The general idea is to offer a simple way of managing "workspaces" integrating multiple git repos starting from a top one, and without the need of difficult "arcanes" like git submodules, git-subtree, etc.: you only need to declare your intended layout in a YAML file, and let this script do its job. See the simplest-git-subrepos README for a long-wired explanation.

Contents:

  1. usage
  2. development
    1. build
    2. publish
  3. license

usage

This project is published to the PyPI index so, in order to install it you just need to run pip install multigit.

multigit expects a YAML file named subrepos on the root directory of the current repo (see example).

For each defined subrepo, it will clone/checkout it to the defined relative path. Optionally, it will checkout the given gitref (either commit, branch or tag), provided the repo's local sandbox is "clean" (i.e. no pending modifications).
NOTE: pay attention to the fact that if the gitref you record is a specific commit or tag, the related sandbox will be in disconnected state.

multigit will also recursively look for new subrepos files on the repositories it manages.

You should make sure your .gitignore file ignores all your subrepos.

This way you just need to manage your repos with git in the standard way, just as if they were individually checked out in isolation.

back to top.

development

This project uses the help of Bash Magic Enviro to configure its development environment.

It creates a Python 3 virtualenv using the companion requirements file.

Once the virtualenv is (automatically) activated, you can run this code by means of the helper cmd script, i.e.: ./python-multigit-cmd.py.

back to top.

build

The included Makefile will use Python's setup tools to build both source and binary-based Python eggs. Provided everthing went OK, look for packages under the dist/ directory.

Run make to see available make targets.

back to top.

publish

Provided Makefile includes publication targets to both testing and live PyPi services by means of twine. Make sure your ~/.pypi.rc file includes proper entries named [testpypi] and [pypi] respectively. Remember, also, that you can't publish the same version twice to these services, so make sure you udpate the package's version before attempting an upload.

back to top.


License

Python Multigit is made available under the terms of the GPLv3.

See the license file that accompanies this distribution for the full text of the license.

back to top.

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

multigit-0.2.0.tar.gz (17.1 kB view hashes)

Uploaded Source

Built Distribution

multigit-0.2.0-py3-none-any.whl (18.1 kB view hashes)

Uploaded Python 3

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