1

I switched servers, so I simply rsynced the remote git repository to which I was pushing and pulling changes from over to new server. Now I tried to fetch from it and am getting error:

ssh://user@domain.com:1234/home/user/gitrepos/project.git: 
cannot execute: git-upload-pack '/home/user/gitrepos/project.git'

What could be causing this problem? How can I troubleshoot?

P.S. domain and ports, along with file repo dir location are all correct.

xelco52
  • 5,257
  • 4
  • 40
  • 56
DavidW
  • 5,069
  • 14
  • 46
  • 68
  • 2
    Does `git-upload-pack` on the remote server exist? does your `user` account have privileges to execute it? – sarnold Jun 09 '12 at 00:11
  • @sarnold I didn't realize git was not installed on the new server. That fixed the issue. If you'd like create an answer so that I can mark you. Thank you very much for the tip. – DavidW Jun 09 '12 at 00:24
  • You also need to make sure `git-upload-pack` is on the path from a non-login shell, which isn't always true even when it is installed. See this question for more: http://stackoverflow.com/questions/225291/git-upload-pack-command-not-found-how-to-fix-this-correctly – georgebrock Jun 09 '12 at 12:54

1 Answers1

2

When you're using git on a remote server, the remote peer also needs git installed. (It's a bit like rsync -- having software on the remote endpoint allows for computing details on the remote peer to avoid needless network traffic.)

So, be sure that a fully-functional git is installed on the remote peer, the commands are located on the PATH when you log in via ssh normally as georgebrock points out, and your user account has privileges to execute the commands (in case your login shell is confined with a mandatory access control tool such as AppArmor, SELinux, TOMOYO, or SMACK).

Community
  • 1
  • 1
sarnold
  • 102,305
  • 22
  • 181
  • 238