In some cases you want to install git where you are only a user, the .bashrc is not being interpreted, and sshd does not allow you to send the path variables, in short a locked down system. What you do in this case, you unpack the binary packages into some path, and prepend that path via a git ssh command script to your ssh command. Here we do this for sdf, the superdimensional fortress that gives you lifetime shell and web hosting for $36 one time fee (http://sdf.lonestar.org/index.cgi?access). It is running netbsd 6.0 on an amd64 machine , so we fetch the binaries right off the server.
How to install git on sdf as a arpa member :
mkdir ~.local cd ~.local/ wget http://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/amd64/6.0/All/git-base-2.10.0.tgz wget http://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/amd64/6.0/All/git-2.10.0.tgz tar -xzf git-2.10.0.tgz tar -xzf git-base-2.10.0.tgz rm *.tgz
- On your client machine :
- Setup your ~/.ssh/config
- Setup ssh login script to prepend path
#!/bin/bash shift # remove the hostname that is arg1 # now we set the path and call the command without the hostname # host name is sdf that is configured in the .ssh/config exec /usr/bin/ssh sdf "export PATH=/sdf/arpa/gm/h/h4ck3rm1k3/.local/libexec/git-core/:/sdf/arpa/gm/h/h4ck3rm1k3/.local/bin:/usr/pkg/bin:/usr/local/bin:/usr/bin:/bin;$@"
- Setup your git config to use custom login script
[core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true sshCommand=/home/mdupont/.ssh/sdfgit.sh [remote "origin"] uploadpack = /sdf/arpa/gm/h/h4ck3rm1k3/.local/libexec/git-core/git-upload-pack url = ssh://sdf:/sdf/arpa/gm/h/h4ck3rm1k3/html
Host sdf User h4ck3rm1k3 HostName sdf.org