Crates.io | gitconf |
lib.rs | gitconf |
version | 0.1.0 |
source | src |
created_at | 2022-04-23 17:23:54.478791 |
updated_at | 2022-04-23 17:23:54.478791 |
description | Overlay utility for more convenient and flexible configuration of git |
homepage | |
repository | https://github.com/DomesticMoth/gitconf |
max_upload_size | |
id | 572731 |
size | 55,835 |
Overlay utility for more convenient and flexible configuration of git
Git allows you to set local and global settings, but the management of these settings leaves much to be desired.
Gitconf tool works as an overlay that adds a configuration profile mechanism to git.
With gitconf, you can create multiple git settings profiles in the system and switch between these profiles in each specific repository with one command.
Since gitconf is an overlay, you can execute all classic git commands through it.
For example, gitconf clone
instead of git clone
.
In this case, gitconf will make sure that the git settings match the selected profile before executing the command.
You can also set up an interactive profile selection dialog that is displayed when you start working with a new repository.
Gitconfig inherits all existing git commands but also adds a few of its own.
Shows a list of all settings profiles visible from the current directory.
Shows settings contained in the selected profile. Accepts the profile name as a single argument.
Sets the selected profile in the current directory. Accepts the profile name as a single argument.
Installs the profile file located at the specified path in the current directory.
Accepts the path to the profile file as a single argument.
Gitconf stores configuration data in directories named .gitconf. Gitconf is looking for a directory .gitconf by the path in which it is launched and by each parent path. Profiles are stored in .gitconf/profiles as toml files. A copy of the currently selected profile is stored in .gitconf/current. Configs located on the closer path takes precedence over what is further away. Similar to how it is done in git, the global settings file is read first, and then all the lower ones in turn. Each config overrides or extends parameters of the higher one. Also the config located in /etc/.gitconf is considered the most global.
Usually, when installing giconf, the default config is created in "/etc/.gitconf/current/DEFAULT".
You can use it as an example.
Profile file can contain the following parameters
Boolean option telling gitconf to ignore all higher-level configs. By default, false.
A boolean option instructing gitconf to overwrite any git settings made not through gitconf itself. By default, true.
Show the profile dialog with the profile selection when starting work in a new repository. By default, false.
Print the name of the current profile in stdout when calling the git command. By default, true.
Enables showing interactive dialogs. By default, false.
Key-value dictionary. The gle key is a git parameter and the value is its value.
Require
# Clone project
git clone https://github.com/DomesticMoth/gitconf.git
cd gitconf
# Build native
make build
# Install
sudo make install
You may download prebuilt deb packages from releases page
v0.1.0 sha1 checksums
gitconf-arm7.gz f597a8d3ae7416713364b5be9221f0cef5608c02
gitconf-x64.gz 1c917fad94e14c5672f0f8272ff1b7bba7803a1a
gitconf-deb-arm7.deb b2b4bc614a88466c44012bf0ee5f700f93c4e146
gitconf-deb-x64.deb 6d61db782b4ac1a74aca1f80ea6c91547f7c7642
You can also build a deb package from the source code yourself
Require
# Clone project
git clone https://github.com/DomesticMoth/gitconf.git
cd gitconf
# Build for x86-64
make build-deb-x64
# or for arm7
make build-deb-arm7
# Builded packages are saved in the ./out directory
cargo install gitconf