[Go to site: main page, start]

Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Install using Cargo

Crate available on Crates.io

Requirements

Cargo

  1. Install Cargo

  2. Check the installation with this command :

    cargo --version
    

    If 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

  1. Install git manually

  2. Make sure it is available in your $PATH, you can check it with this command :

    git --version
    

    If it has been well settled, it should output something like this :

    git version 2.54.0
    

    Else 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

  1. Install binary

    • Use cargo-binstall to 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 you want to compile from source

      Run this command :

      cargo install git-gamble
      
  2. Add ~/.cargo/bin to 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 :

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 includes with_custom_hooks)

    cargo install git-gamble --no-default-features --features "with_subcommand_hook"
    
  • with_custom_hooks

    cargo install git-gamble --no-default-features --features "with_custom_hooks"
    
  • with_subcommand_generate_shell_completions

    cargo 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