threads / discuss / 21402

Is it possible to use git as a remote file storage without making any local repos?

Subject: Is it possible to use git as a remote file storage without making any local repos?

## tl;dr

2 messages between Oct 28, 2009 and Oct 28, 2009.

replies: 1people: 2as markdown or json

Matvejchikov Ilya· Oct 28, 2009, 12:09 UTC · lore
Hi all,
My question is about using git as a remote file storage.

I have a remote storage server with a git-daemon running and I want to be able to put some data in that repo in a way like 'git hash-object -w <object>'. The general problem for me is that I don't want to create any local git repositories that is needed by 'pit push ...' etc.

So, is it possible to use git for remote storage purposes without making local repository?

Thanks.
Avery Pennarun· Oct 28, 2009, 18:33 UTC · re: Matvejchikov Ilya · lore

Re: Is it possible to use git as a remote file storage without making any local repos?

On Wed, Oct 28, 2009 at 8:09 AM, Matvejchikov Ilya <matvejchikov@gmail.com> wrote:

Show 8 quoted lines
> I have a remote storage server with a git-daemon running and I want to
> be able to put some data in that repo
> in a way like 'git hash-object -w <object>'. The general problem for
> me is that I don't want to create any local
> git repositories that is needed by 'pit push ...' etc.
>
> So, is it possible to use git for remote storage purposes without
> making local repository?

This functionality isn't built into git (and it might be considered a security hole, strictly speaking, if a repository let you download any object by default). However, it would be pretty easy to create your own server that does this.

For example, you could make one CGI script that dumps its POST data into a pipe to "git hash-object --stdin -w"

I've written a service similar to this at work. It's relatively simple to do a basic version. Of course, as you get into more complicated situations (what about multiple users updating the same filename? merges? authentication?) it gets more complicated. But I think everybody would want this for a different reason, so it's unlikely that there'll ever be a single "standard" solution.

Have fun,
Avery

← back to recent threads