Skip to content

Install libgit2

SuperBo edited this page Jul 4, 2024 · 7 revisions

libgit2 is the core of git tasks in Fugit2. In order to use this plugin, you have to install and configure libgit2 first.

See plugin setup for detail plugin setup after done installing libgit2.

Ubuntu 22.04

sudo apt-get install -y libgit2-1.1
# sudo ln -s /usr/lib/x86_64-linux-gnu/libgit2.so.1.1 /usr/local/lib/libgit2.so
# sudo ldconfig

Set libgit2_path value in config options like this

-- Fugit2 setup table
{
  libgit2_path = 'libgit2.so.1.1',
  ...
}
# rocks.toml
[plugins."fugit2.nvim".config]
libgit2_path = "libgit2.so.1.1"

Ubuntu 23.10

sudo apt-get install -y libgit2-1.5
# sudo ln -s /usr/lib/x86_64-linux-gnu/libgit2.so.1.5 /usr/local/lib/libgit2.so
# sudo ldconfig

Set libgit2_path value in config options like this

-- Fugit2 setup table
{
  libgit2_path = 'libgit2.so.1.5',
  ...
}
# rocks.toml
[plugins."fugit2.nvim".config]
libgit2_path = "libgit2.so.1.5"

Ubuntu 24.04

sudo apt-get install -y libgit2-1.7

Set libgit2_path value in config options like this

-- Fugit2 setup table
{
  libgit2_path = 'libgit2.so.1.7',
  ...
}
# rocks.toml
[plugins."fugit2.nvim".config]
libgit2_path = "libgit2.so.1.7"

Arch Linux

sudo pacman -S libgit2

Fedora

yum install libgit2

Set libgit2_path value in config options like this, change corresponding version.

-- Fugit2 setup table
{
  libgit2_path = 'libgit2.so.1.7',
  ...
}
# rocks.toml
[plugins."fugit2.nvim".config]
libgit2_path = "libgit2.so.1.7"

NixOS

nix-env -iA nixpkgs.libgit2
# Find libgit2 library path
ls /nix/store | grep "*libgit2-20*

Then put that path to your neovim setup like this

-- Fugit2 setup table
{
  libgit2_path = '/nix/store/<above path>/lib/libgit2.so',
  ...
}
# rocks.toml
[plugins."fugit2.nvim"]
version = "0.2.0"
install_args = [
  "GIT2_DIR=/nix/store/<above path>"
]

[plugins."fugit2.nvim".config]
libgit2_path = "/nix/store/<above path>/lib/libgit2.so"

Mac OS

brew install libgit2

Set libgit2_path value in config options like this if you have problem loading libgit2 library with default settings.

Mac Arm M1/M2/M3

-- Fugit2 setup table
{
  libgit2_path = '/opt/homebrew/lib/libgit2.dylib',
  ...
}
# rocks.toml
[plugins."fugit2.nvim"]
version = "0.2.1"
install_args = [
  "GIT2_DIR=/opt/homebrew"
]

[plugins."fugit2.nvim".config]
libgit2_path = "/opt/homebrew/lib/libgit2.dylib"

Mac Intel

-- Fugit2 setup table
{
  libgit2_path = '/usr/local/opt/libgit2/lib/libgit2.dylib',
  ...
}
# rocks.toml
[plugins."fugit2.nvim"]
version = "0.2.1"
install_args = [
  "GIT2_DIR=/usr/local/opt/libgit2"
]

[plugins."fugit2.nvim".config]
libgit2_path = "/usr/local/opt/libgit2/lib/libgit2.dylib"

Windows

choco install libgit2
-- Fugit2 setup table
{
  libgit2_path = '/path/to/libgit2/libgit2.dll',
  ...
}
# rocks.toml
[plugins."fugit2.nvim"]
version = "0.2.1"
install_args = [
  "GIT2_DIR=/path/to/libgit2"
]

[plugins."fugit2.nvim".config]
libgit2_path = "/path/to/libgit2.dll"