1

I know there is already a similar post, but it seems that the solutions proposed do not work for me...

My colleague has created a repository /git/work under his account. On my remote machine, I can do the following:

... > git clone /users/.../HisAccount/git/work
Initialized empty Git repository in /import/.../MyAccount/work/.git/

But I need to control remotely my machine/account, so I have tried the following on my local machine and got an error:

...@ubuntu$ git clone MyAccount@OurDomain:/users/.../HisAccount/git/work
Cloning into work...
MyAccount@OurDomain's password: 
sh: git-upload-pack: command not found
fatal: The remote end hung up unexpectedly

On my both local and remote machines, I can see /usr/bin/git-upload-pack. The path on my local machine is /usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games; and the path on my remote machine is /users/.../MyAccount/bin/ubuntu /users/.../MyAccount/bin /user/local/bin /usr/bin /bin /usr/hosts /usr/ucb /usr/openwin/bin .

On my local machine, I have also tried this:

... > git clone -u /usr/bin/git-upload-pack MyAccount@OurDomain:/users/.../HisAccount/git/work
Cloning into work...
MyAccount@OurDomain's password: 
sh: /usr/bin/git-upload-pack: No such file or directory
fatal: The remote end hung up unexpectedly

By the way, I don't really know where are .bashrc (for Bash), .zshenv (for Zsh) or .cshrc (for tcsh)...

Could anyone help?

Community
  • 1
  • 1
SoftTimur
  • 5,630
  • 38
  • 140
  • 292

1 Answers1

0

Check the $PATH, as set in your ".bashrc(for Bash),.zshenv(for Zsh),.cshrc` (for tcsh)"
(depending on the current shell you are running)

One of those files should be in your $HOME (homedir).

From the comments, the OP confirms that

  • /usr/bin/git-upload-pack: No such file or directory means that the PATh (which is correct) actually doesn't include the git-upload-pack script. This answer suggests to symlink to it.
  • that git-upload-pack script is called on the remote side, as the OP confirms:

It turns out that the remote machine has problem... I have tested with another machine, and it works.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • On the remote machine, none of these 3 files exists (the shell is tcsh); On the local machine, there is `.bashrc`, but I have not found `path` in it... – SoftTimur Feb 26 '12 at 19:22
  • @SoftTimur those files don't have to always exist. They are created by the user only if he/she want to modify some environment variable in his/her shell session. – VonC Feb 26 '12 at 20:39
  • So, should I add a `.cshrc` on my remote machine and change `$PATH`? But its current `$PATH` does conclude `usr/bin`... – SoftTimur Feb 26 '12 at 21:54
  • @SoftTimur: except that path doesn't help: `/usr/bin/git-upload-pack: No such file or directory`. You need to check on the Git installation. – VonC Feb 26 '12 at 22:51
  • 1
    I need to check git installation on my local machine or remote machine? – SoftTimur Feb 27 '12 at 00:28
  • @SoftTimur: on the remote. Once you have found where git is installed, you can symlink to it (http://stackoverflow.com/a/550145/6309) – VonC Feb 27 '12 at 07:12
  • it turns out that the remote machine has problem... I have tested with another machine, and it works... thank you... I am going to delete the question soon... – SoftTimur Feb 27 '12 at 19:55
  • @SoftTimur don't delete it! It will help others – VonC Feb 27 '12 at 19:57
  • @SoftTimur I have included your conclusions in the answer for more visibility. – VonC Feb 27 '12 at 20:40