Question: I'm messing around with the Ruby Git gem... seeing how I can use it to manage/access a Gitosis server I'm running. Does anyone know if it is possible to add/commit files to a local bare repo, or will I need to set up a local 'normal' repo and use SSH to push it to the bare repo on the localhost?

Answer: 
You should be able to do this using low level **plumbing** commands:

```

$ *generate\_contents* | [git hash-object](http://www.kernel.org/pub/software/scm/git/docs/git-hash-object.html) -t blob -w --stdin
$ [git update-index](http://www.kernel.org/pub/software/scm/git/docs/git-update-index.html) --cacheinfo 100644 *sha1 path*

```

* *sha1* is result of previous command.
* `100644`: means an ordinary file.

But *bare repositories* are meant to be used only to push into or fetch from. Bare repository doesn't need to have index at all!
You need a working tree to add a file to the index and commit it.  

While it might be possible to change directly the internal content of a bare git repo through plumbing commands, I would really recommend setting up a normal clone, modify it and push the resulting commit back to the bare repo.