1

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?

Ian1971
  • 3,666
  • 7
  • 33
  • 61
  • Is that really a pull? (That "To" on the last line doesn't make much sense.) As for the answer, that's strange - the "invalid optione" line isn't prefixed by "remote: ", so it would seem to be on *your* end. I do know that `git pull` is implemented as a shell script, so this could be happening within it. What version of `git` are you using? – Cascabel Apr 11 '11 at 12:58
  • Check your .git/config file for any invalid options – sehe Apr 11 '11 at 13:02
  • That was a push...sorry my typo. Client is 1.6.5.1 – Ian1971 Apr 11 '11 at 13:04
  • @Jefromi - on a 1.7.4 client it does have remote: as a prefix – Ian1971 Apr 11 '11 at 13:06
  • What OS do you have? What is the version of git and bash on your client machine? – static_rtti Apr 11 '11 at 13:06
  • Server is Windows 2008, client XP. Tried clients with 1.6.5.1 and 1.7.4. Using cygwin latest version (1.7.9 I think) – Ian1971 Apr 11 '11 at 13:09
  • 1
    @Ian: Okay, if it's on the remote end, then it might well be a problem with your gitosis installation - which does raise the question of why you're using gitosis instead of gitolite (which is still maintained, and fuller-featured). What happens if you just `ssh git@mytestserver`? – Cascabel Apr 11 '11 at 13:10
  • 1
    I guess I'd not run across gitolite. Sounds like I should be using that. – Ian1971 Apr 11 '11 at 13:11
  • In the end I used gitolite and that was much easier to set up. – Ian1971 Apr 18 '11 at 11:05

1 Answers1

1

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).

Wes Hardaker
  • 21,735
  • 2
  • 38
  • 69
  • Thanks this answer my question. I got around it by using gitolite instead as suggest by Jefromi. – Ian1971 Apr 18 '11 at 11:05