Search code examples
gitgitosis

What does invalid option mean when I do a git push?


I have set up my own git server with gitosis. It seems to be functioning correctly but when I do a git push I get an error message

Counting objects: 5, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 388 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
: invalid optione: line 2: set: -
set: usage: set [--abefhkmnptuvxBCHP] [-o option-name] [arg ...]
To ssh://git@mytestserver/~/repositories/gitosis-admin.git

A subsequent pull does however work and seems to correctly merge.

Ideas?


Solution

  • That error is coming from the shell on the remote system (bash most likely). So the login shell on the remote system is probably trying to execute a source file (like ~/.profile) that is broken. This could also be, for example, that the user's shell is something like /bin/bash but somewhere in git or the execution path that ssh is invoking, is calling /bin/sh instead (which might be older with less options).