Install using Cargo
Requirements
Cargo
-
Check the installation with this command :
cargo --versionIf it has been well settled, it should output something like this :
cargo 1.80.0 (376290515 2024-07-16)Else if it has been badly settled, it should output something like this :
cargo: command not found
Git
git-gamble doesn’t repackage git, it uses the one installed on your system
-
Make sure it is available in your
$PATH, you can check it with this command :git --versionIf it has been well settled, it should output something like this :
git version 2.54.0Else if it has been badly settled, it should output something like this :
git: command not found
Using with old git version
Note : if you are using a very old version of git (below 2.36)
With old git version, git-gamble will fail with this error
git: 'hook' is not a git command. See 'git --help'.
The most similar commands are
fork
lock
root
Failed to execute `git hook run --ignore-missing pre-gamble -- pass` in . returns code 1
The pre-gamble hook returns code 1, but it should be 0
You can test the hook by executing : git hook run --ignore-missing pre-gamble -- pass
No tests have been run, and nothing has been committed or reverted
git 2.36 was released the 2022-04-18, and is now available in most package managers
If you can, try to upgrade git using your package manager
Else, to use git-gamble with git below 2.36, git-gamble’s hooks must be disabled by installing git-gamble with the option to disable the feature
Install
-
Install binary
-
Use
cargo-binstallto avoid compilation- If binaries are available for your platform
- It will download binaries
- Else
- It will fall back to compilation from source
Run the following command :
cargo binstall git-gamble - If binaries are available for your platform
-
If you want to compile from source
Run this command :
cargo install git-gamble
-
-
Add
~/.cargo/binto your$PATH-
Fish :
set --export --append PATH ~/.cargo/bin -
Bash / ZSH :
export PATH=$PATH:~/.cargo/bin
-
Remove optional features
Cargo have a mechanism to enable or disable features at compile time
By default, git-gamble is compiled with :
- sub-command hook (
with_subcommand_hook)- which requires and includes custom hooks support (
with_custom_hooks)
- which requires and includes custom hooks support (
- shell completions (
with_subcommand_generate_shell_completions)
To remove these features, install using the following command :
cargo install git-gamble --no-default-features
To enable only one of these features :
-
with_subcommand_hook(requires and includeswith_custom_hooks)cargo install git-gamble --no-default-features --features "with_subcommand_hook" -
with_custom_hookscargo install git-gamble --no-default-features --features "with_custom_hooks" -
with_subcommand_generate_shell_completionscargo install git-gamble --no-default-features --features "with_subcommand_generate_shell_completions"
Check the installation
Check if all have been well settled :
git gamble --version
If it has been well settled , it should output this :
git-gamble 2.14.6
Else if it has been badly settled , it should output this :
git : 'gamble' is not a git command. See 'git --help'.
Update
cargo update --package git-gamble
Uninstall
cargo uninstall git-gamble