What causes git interactive to not be present when git is installed?
Asked Answered
O

3

7

Running on Alpine Linux 3.10, I've installed the distribution's git package using apk.

In an existing checkout directory, when I try to launch git add's interactive mode:

$ git add -i

I get the error:

git: 'add--interactive' is not a git command. See 'git --help'.

The git add help indicates that -i is a valid option.

What is happening?

Odie answered 23/8, 2019 at 20:41 Comment(0)
O
11

The interactive mode feature of git uses perl, and in many Linux distributions the perl-based parts of git are separated out into another package, so that the core functionality of git can be used without needing to install perl.

On Alpine, the git package just has this core functionality.

To get the missing functionality on Alpine, install the git-perl package.

$ sudo apk add git-perl
Odie answered 23/8, 2019 at 20:41 Comment(1)
Actually perl keeps their source in git so it's probably kind of handy for them that distros break the dependency cycle. :POdie
C
1

From Git v2.25.0 onward, released in January 2020, none of the following require a separate installation on Alpine Linux:

  • git add -i (git add --interactive)
  • git add -p (git add --patch)

These tools have been ported from Perl to C,¹ and the Perl version of git-add--interactive (git-add--interactive.perl) were removed altogether in Git v2.40.0,² which was released in March 2023.

  1. git/git@c5f7b2a6fe...5a7d41d849
  2. github.blog/2023-03-13-highlights-from-git-2-40
Cd answered 14/3, 2023 at 23:23 Comment(0)
B
0

On RedHat Linux, you may need to add the perl-Git package:

$ sudo dnf install -y perl-Git
Burbage answered 19/7, 2022 at 18:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.