Home > General > git gotcha

git gotcha

September 10th, 2008

Just thought I’d post about a problem I was having with git concerning the setup and cloning of a remote repository. Basically, if you’ve setup a repository on a remote machine, and want to clone from that machine onto a local one using ssh, you may run into problems like I did.

The error I received was:

ThaDonMBP:workspace craiger$ git clone craiger@192.168.2.10:/git/myproj
Initialized empty Git repository in /private/workspace/myproj/.git
craiger@192.168.2.10's password:
bash: git-upload-pack: command not found
fatal: The remote end hung up unexpectedly

The problem is that git is expecting git-upload-pack in a specific directory on the remote machine, and that is /usr/bin or /usr/local/bin. That’s *not* where I had git installed, I had it installed in /opt/git/bin. So all you need to do is symlink your git executables to /usr/bin like so:

craiger@192.168.2.10:~$ cd /usr/bin
craiger@192.168.2.10:/usr/bin$ sudo ln -s /opt/git/bin/* .

After that, things should work!

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • Reddit
  • TwitThis

About the Author

Craig Tataryn started his career as a Visual Basic programmer, but don't hold that against him! The system he helped create was a cutting edge, n-tiered revenue collection system whose transactions per second metric was off the charts! Around the year 2000 he discovered Struts and never looked back. A professional Java developer for close to a decade, Craig has worked on a wide variety of projects ranging from Recruiting, Purchase order, Revenue collection and Mortgage systems. More recently Craig has written web services for children's educational toys and has honed his skills on Wicket, Facebook and iPhone application development. "I love to learn and more importantly I love to teach. Hoarding knowledge is one of the most petty and selfish things you can do, especially as a contractor. This is why I always make it a point to document and share my knowledge with my client's employees"

craig General

  1. No comments yet.
  1. No trackbacks yet.