Setup Gitui

GitHub repository: gitui-org/gitui

Installation

For Fedora

sudo dnf install gitui

On Windows in admin powershell

winget install -e --id StephanDilly.gitui

https://github.com/extrawurst/gitui?tab=readme-ov-file#installation

On MacOS

brew install gitui

For Ubuntu and derivatives It is not available with APT, the best option is probably to compile from source

cargo install gitui

Make sure an SSH agent is running

To avoid the issue git error: bad credentials, Gitui needs to have an additional configuration to be able to push and pull...

With Fish

If you have another shell like Bash, please replace (ssh-agent -c) by "$(ssh-agent -s)" in the following notes.

To make Gitui access push and pull operations, your SSH key used for authentication must be available.

If you have a passphrase, you have to enter these lines in your config.fish to start the SSH agent and add your SSH key. The passphrase will be asked once everytime your Fish is starting.

eval (ssh-agent -c) &>/dev/null
ssh-add

If that's annoying you can choose to run ssh-add manually when needed instead of at each Fish start. If you want to remove your passphrase you can run ssh-keygen -p.

If you don't have a passphrase on your key, just enter these 2 lines in your config.fish.

eval (ssh-agent -c) &>/dev/null
ssh-add &>/dev/null

On Windows

According to the GitHub docs you can start the SSH service and add your keys with the following commands.

# start the ssh-agent in the background
Get-Service -Name ssh-agent | Set-Service -StartupType Manual
Start-Service ssh-agent

Then, this command but make sure to adjust YOU with your username and id_ed25519 with the name of your private key if you used another name.

ssh-add c:/Users/YOU/.ssh/id_ed25519

Setup your quick fix editor

Pressing e (think edit) on a file will open it to quickly fix something. But it opens vi by default. You can change this editor with the GIT_EDITOR command.

With Fish, here is how you can open nvim. Choose any editor, like code for VSCode or others...

set -g GIT_EDITOR nvim # so Gitui doesn't open vi...

Same idea with Bash syntax

export GIT_EDITOR=nvim # so Gitui doesn't open nano...

On Windows, to configure to open VSCode.

setx /m GIT_EDITOR code.cmd

Verify Git + Gitui setups

Now, I suggest to create a new private repository in Github, try to clone it, create a random file, commit it and push it. If the entire flow is working, you have a working Git setup.