Linux

git: ‘index-pack’ is not a git-command. See ‘git --help’. fatal: index-pack failed

I am using capistrano to deploy to a dedicated server. It has been working fine for days, then last night it stopped working.

I investigated the trace and saw this error:

1
2
git: 'index-pack' is not a git-command. See 'git --help'. 
fatal: index-pack failed

So, I signed in to the server and tried to run a few variations of fetching and cloning my repository and other public repositories and got the same error.

Then I decided to sign in as root and another normal user. Those users were able to do git commands with no problems.

After a bunch of work trying to find the difference I discovered that my failing user had:

1
2
echo $SHELL
/usr/local/cpanel/bin/jailshell

whereas my other users had:

1
2
echo $SHELL
/bin/bash

So, I signed in as root and changed my user’s shell to bash and now everything works just fine:

1
2
ssh root@xxx.xx.xx.xx
chsh -s /bin/bash username

Reader Discussion

Tom Mason

Wednesday July 08, 2009 at 2:28pm

Hello,

This is an interesting problem, I’m seeing the same thing also on a cpanel server. I had given the user bash under WHM, but that didnt seem to fix the problem.

Your command did though - so thanks!

Toon Claes

Monday September 07, 2009 at 10:30am

Well I’m having that problem too. But I did install git on a 3th party shared hosting. Git just doesn’t recognize: git index-pack. Not even in the regular ssh session.

An idea?

Chas

Monday November 23, 2009 at 6:57am

THANKS! Was running into the same problem this morning and your solution was exactly what I needed.

dericbytes

Sunday January 31, 2010 at 5:53am

I had the same problem. I solved it by changing my path variable.

Bash solution

$ type -a git
> git is /cygdrive/c/cygwin/bin/git

$ export PATH=/bin:$PATH
$ type -a git
> git is /bin/git
> git is /cygdrive/c/cygwin/bin/git

Comment on this post




Please enter the word you see in the image below:


Related posts

Using /home/* on a mac

I want the path on my Mac dev environment to match the path on my Linux server (I am doing this for ExpressionEngine, where it’s much easier to deploy to different servers if the paths match).

My Linux server path starts with /home/myusername. Unfortunately, in Mac Leopard the /home directory is not editable, so I cannot put my files in the directory I need.

I found a solution buried in an Apple support forum message. The solution is to comment out an entry in the the auto_master file.

Here are the steps:

  1. edit the file: /etc/auto_master
  2. comment out this line: # /home auto_home -nobrowse
  3. save & reboot

After reboot the /home directory acted like I expected and now I have my ExpressionEngine files where I need them.

read more

Adding fonts on Linux without sudo

I am using a hosting service, which doesn’t allow me sudo access.  Yet I want to install additional fonts.

I don’t recall all the steps I did, but I got it working.  First, I installed fontconfig in under my home directory, such that:

1
2
$ which fc-list
~/bin/fc-list

then when I want to install new fonts I copy the ttf file to the ~/.fonts directory like:

1
2
$ scp Georgia.ttf user@myurl.com:~/.fonts/g.ttf
Georgia.ttf     100%  146KB  73.1KB/s   00:02

then in order to reset the font cache I run

1
2
3
$ fc-cache -v ~/.fonts
fc-cache: "/home/me/.fonts": skipping, 6 fonts, 0 dirs
fc-cache: succeeded

then when I run fc-list, I’ll see my new font in the list

1
2
$ fc-list
Georgia:style=Regular

read more