If the remote system does not have Git in the default PATH system (which is probably different from the PATH in your login shell), you should tell it where to find git -receive-pack.
You mentioned the path /usr/local/git/bin/git-receive-pack , so try this:
git push --receive-pack=/usr/local/git/bin/git-receive-pack ssh:// user@machine1 :/try-git master
The path specified in --receive-pack= is the path to git -receive-pack on the remote system.
You can save the git -receive-pack path as part of "remote" to save text input if you plan to access this repository many times:
git remote add machine1 ssh:// user@machine1 :/try-git git config remote.machine1.receivepack /usr/local/git/bin/git-receive-pack git config remote.machine1.uploadpack /usr/local/git/bin/git-upload-pack
Use it as follows:
git push machine1 master
The remote.<remote-name>.uploadpack configuration configuration eliminates the need for the --upload-pack= option for git fetch (and git pull ) in the same way as remote.<remote-name>.receivepack eliminates the need to specify --receive-pack= using git push .
In your specific scenario, you click on a non-bare repository. You also probably clicked on the branch that was checked (pushing master on machine2 on master on machine1). Modern versions of Git will give you an error when trying to do this. You can override this warning by setting specific configuration variables, but this is usually not the best way to work.
source share