### (next command) works fine if I force the path at the time I push. So git seems### git-receive-pack if I force the same path shown when I echo the $PATH below.
/usr/local/git/bin/git is a nonstandard path, and is something you added to the path yourself, yes? Is is possible that the configuration file you used only applies to login shells, and not for a noninteractive shell?
As a general case, rather than continually adding to the path and growing it ever longer, I tend to symlink things in to the correct spots.
So:
cd /usr/local/bin && ln -s /usr/local/git/bin/* .
It also has a nice secondary effect of avoiding problems like this.
I described the whole process how I got this working without the errors when I tried to pust to the remote repository, in the hopes it might help someone else. I could have been here till the cows came in, if it hadn't been for matthew Caron and his constant help.At the Server :
I restored the server boot disk from an earlier backup, and started over again by getting the osx installer from the git official site.----------Latest stable release (download installer)1.7.11.1Release Notes (2012-06-21)http://git-scm.com/download/mac----------Double clicked on the installer from the git site, installed and restarted the server. After it came up to speed I checked :$ which git---> /usr/local/git/bin/gitWhich shows a non standard path as you can see.
The OSX Server (Snow Leopard) configuration that I am using, has one local admin user with a home directory. The other users are not local users, but LDAPv3 users, so they exist for the purposes of authentication, etc., and have no home directories assigned to them, which is where the problem with the 'interactive shell path' vs the 'non-interactive shell path' comes into play.I don't know where the main system wide 'non-interactive shell path' is set at, but one place I was able to set the 'non-interactive shell path' is at ~/.bashrc . Since I did not have a home directory on the server, there was no way to access ~/.bashrc in order to add the git path. So with this problem in mind, I created a home directory for myself and added a ~/.bashrc file.I noticed that if I SSH into the remote server vialocal $ ssh ros...@192.168.1.45then try to get the $PATH via :server:~ roscoe $ echo $PATH
---> /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/bin
the path that is returned is the 'interactive shell path'. Good so far...But if instead of logging into the server via ssh, I just issue a remote command (as shown below), then I get the 'non-interactive shell path', which is different from the one above...$ ssh ros...@192.168.1.45 'echo $PATH;'
---> /usr/bin:/bin:/usr/sbin:/sbin
So with this problem in mind (this is a little repetitious, but bare with me), I created a home directory for myself on the server and added a ~/.bashrc file with the following contents, with the last two lines only used during testing...# (BEGIN) ~/.bashrcGIT_PATH=/usr/local/git/binPATH=$PATH:${GIT_PATH}export PATHecho -e "GIT_PATH = ${GIT_PATH} : path set in /Users/roscoe/.bashrc"echo -e "Called from : /Users/roscoe/.bashrc \nThe current path is : ${PATH}"# (_END_) ~/.bashrcOn the next command, I get the correct value for the 'non-interactive shell path', which includes '/usr/local/git/bin', hallelujah...$ ssh ros...@192.168.1.45 'echo $PATH;'---> /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/binIf I now SSH into the server, I notice below that the path I added in ~/.bashrc does not create a duplicate entry in the 'interactive shell path'SSH into the server, then check the 'interactive shell path'
$ ssh ros...@192.168.1.45---> Password:
server:~ roscoe $ echo $PATH
---> /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/bin
server:~ roscoe $Sure enough, everything appears OK now. I will test this out !$ cd 'data/git/sandbox/tmp/'$ pwd---> data/git/sandbox/tmp
$ git status---> # On branch master---> nothing to commit (working directory clean)
Made some slight changes to the file 'projects/www/index.php' in order to get a valid change in status
$ git status---> # On branch master
---> # Changes not staged for commit:---> # (use "git add <file>..." to update what will be committed)---> # (use "git checkout -- <file>..." to discard changes in working directory)---> #---> # modified: projects/www/index.php---> #---> no changes added to commit (use "git add" and/or "git commit -a")$ git add projects/www/index.php
$ git status---> # On branch master
---> # Changes to be committed:---> # (use "git reset HEAD <file>..." to unstage)---> #---> # modified: projects/www/index.php---> #$ cd 'data/git/sandbox/tmp/'
$ git status---> # On branch master
---> # Changes to be committed:---> # (use "git reset HEAD <file>..." to unstage)---> #---> # modified: projects/www/index.php---> #$ git commit -m "Testing to overcome remote origin problems."---> [master da64db1] Testing to overcome remote origin problems.---> 1 files changed, 3 insertions(+), 1 deletions(-)$ git remote rm origin---> error: Could not remove config section 'remote.origin'$ git remote add origin ssh://ros...@192.168.1.45/Volumes/Git/Remote/tmp
$ git push origin master---> Password:
---> fatal: protocol error: bad line length character: Call
---> fatal: The remote end hung up unexpectedly
I could not figure out why now I had a new problem, but I reset the /Volumes/Git/Remote permissions on the server , tried it again, and life is now swell. You can see below that it worked...
$ git push origin master---> Password:
---> Counting objects: 15, done.---> Delta compression using up to 2 threads.---> Compressing objects: 100% (10/10), done.---> Writing objects: 100% (15/15), 1.60 KiB, done.---> Total 15 (delta 1), reused 0 (delta 0)---> To ssh://ros...@192.168.1.45/Volumes/Git/Remote/tmp---> * [new branch] master -> master$
I tried to pust to the remote repository
I've attached a picture of my email response, which for some reason gets all messed up when I reply via email instead of on the google group web page.