The scenario
- I have access to this old linux server, that no longer receives any type of updates. Only break and fix. There's no git installed on the server so I installed it locally on my user at ~/opt/bin. I added the directory to my path and for development on the server I can do pretty much everything I need to do with git.
- I decided it would be cool to do my development on my workstation instead, and push to production code that is ready.
- I set up a bare repository at my server, created a post-receive file with a checkout -f to my GIT_WORK_TREE and seems like everything is setup accordingly.
The problem
When I try to push my master branch, I get the following error:
sh: git-receive-pack: command not found
fatal: The remote end hung up unexpectedly
I know why this is happening. The $PATH on my SSH is only seeing /usr/bin:/bin:/usr/sbin:/sbin
My user is setup with a /bin/sh shell so using .profile/.bashrc/.bashprofile is not an option.
I can't use .ssh/environment either, because my PermitUserEnvironment
is set to no.
I tried to create a hooks/pre-receive and set the path there, that did not work either.
Any idea on how to make SSH see git and get this working?
Thanks