A git clone wrapper that automatically uses --reference to save time and space.
A git clone wrapper that automatically uses –reference to save disk space and download time.
To install git-autoshare in a fancy way, we recommend using pipx.
After installing pipx simply run:
$ pipx install git-autoshare
To upgrade git-autoshare at any time:
$ pipx upgrade git-autoshare
If you want git autoshare-clone to be invoked transparently in place of git clone, create the following bash script, name it git, and place it in your PATH before /usr/bin/git:
#!/bin/bash if [ "$1" == "clone" ] then shift /usr/bin/git autoshare-clone "$@" else /usr/bin/git "$@" fi
To configure it, create a file named git-autoshare/repos.yml in your user configuration directory (often ~/.config on Linux). This file must have the following structre:
host: repo: orgs: - organization - ... private: (True|False) ...: ...:
It lists all git hosts, repositories, and organizations that are subject to the sharing of git objects. Here is an example:
github.com: odoo: orgs: - odoo - OCA enterprise: orgs: - odoo - acsone private: True mis-builder: # shortcut to provides organizations - OCA - acsone
Note the use of the private option, used to force fetching using the ssh protocol.
It is also possible to use * as a wildcard for repository name, to have autoshare applied to all repos of some organizations:
github.com: "*": orgs: - odoo - OCA - acsone private: True
In this configuration, git-autoshare-prefetch without arguments will not fetch any wildcard repo. This could be improved in the future to refetch repos that are already present in cache.
The cache directory is named git-autoshare where appdirs.user_cache_dir is (usually ~/.cache/git-autoshare/). This location can be configured with the GIT_AUTOSHARE_CACHE_DIR environment variable.
The default configuration file is named repos.yml where appdirs.user_config_dir is (usually ~/.config/git-autoshare/). This location can be configured with the GIT_AUTOSHARE_CONFIG_DIR environment variable.
By default git-autoshare invokes git as /usr/bin/git. This can be configured with the GIT_AUTOSHARE_GIT_BIN environment variable.
- Stéphane Bidoul (ACSONE)
- Simone Orsi (Camptocamp)
- Mykhailo Panarin
This project is maintained by ACSONE SA/NV.
- always prefetch cache before cloning, to make sure the cache is updated regularly
- add submodule-add command
- use safe_load to parse configuration
- allow wildcards in configuration
- internal refactoring
- support for private repositories
- better handling of remotes in prefetch
- prefetch with –prun
- first packaged version
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size git_autoshare-1.0.0b4-py2.py3-none-any.whl (20.1 kB)||File type Wheel||Python version py2.py3||Upload date||Hashes View|
|Filename, size git-autoshare-1.0.0b4.tar.gz (22.2 kB)||File type Source||Python version None||Upload date||Hashes View|
Hashes for git_autoshare-1.0.0b4-py2.py3-none-any.whl