Skip to main content

Simple tool to create virtual git environments (like a python's venv).

Project description

gitvenv

Tool to manage multiple Git environments.

Strongly based on python's venv module.

gitvenv defines four environment variables to make the environment work:

  • GIT_VIRTUAL_ENV – a convenience variable pointing to the environment directory.
  • GIT_CONFIG_GLOBAL – tells Git to use config from the environment.
  • GIT_VIRTUAL_ENV_SSH_CONFIG – a convenience variable pointing to SSH config.
  • GIT_SSH_COMMAND – tells Git to use SSH command with config from the environment: $GIT_SSH -F /path/to/env/ssh_config. If GIT_SSH is undefined, ssh will be used instead.

Installation

Using pip

pip install gitvenv

Using AUR

git clone https://aur.archlinux.org/python-gitvenv.git
cd python-gitvenv/
makepkg -si

Using Git

git clone https://gitlab.com/yataro/gitvenv.git
cd gitvenv/
pip install .

Usage

usage: gitvenv [-h] [--clear] [--copy] ENV_DIR

Creates a virtual Git environment in the target directory.

positional arguments:
  ENV_DIR     A directory to create the environment in.

options:
  -h, --help  show this help message and exit
  --clear     Delete the contents of the environment directory if it already exists, before environment creation.
  --copy      Copy the current config files to the new environment.

Once an environment has been created, you may wish to activate it, e.g. by sourcing an activate script in its bin directory.

bash and PowerShell are currently supported:

bash

gitvenv my_env/
source my_env/bin/activate

# Use environment
git config --global user.name 'John Doe'
git config --global user.email 'john@example.com'

# Deactivate environment
gitvenv_deactivate

PowerShell

gitvenv my_env/
.\my_env\bin\Activate.ps1

# Use environment
git config --global user.name 'John Doe'
git config --global user.email 'john@example.com'

# Deactivate environment
gitvenv_deactivate

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

gitvenv-1.0.3.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

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

gitvenv-1.0.3-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gitvenv-1.0.3.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for gitvenv-1.0.3.tar.gz
Algorithm Hash digest
SHA256 b9d43e6438752ffe202a8475b3aaabaaa4555ab9c5101be4f8bbdf4d895e84b2
MD5 f2ae42c9a812e922abc652d2b99fb115
BLAKE2b-256 be38fdb7f286dcc4d04c30d9f7a14a11538808a835a1b1c96bc8c7b6650756f7

See more details on using hashes here.

File details

Details for the file gitvenv-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: gitvenv-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for gitvenv-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d85f9e213028c3bda8ae07235d7c11574bec315618ea0c7b000800192ffbc221
MD5 0e16292d491b478a9eb9d24340803f39
BLAKE2b-256 b36f97657ff739d089c76fa281deeb2052dd9c71932834cebf1a10136c90aa52

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