[ANNOUNCE] gitolite now has github-like "forking"

Sitaram Chamarty sitaramc at gmail.com
Wed Aug 31 22:00:49 BST 2011


Hello,

[I'm sending this to the larger git community because I'd like to hear
from people interested in this sort of functionality and willing to help
me test it].

Gitolite's current "pu" branch has acquired some features by which it
can now be used to do things like the "fork" operation of github (and
presumably other similar services).  Gitolite will never be web-based,
or GUI, etc., so it's not even remotely in the same class as github but
for some urgent, simple, needs this can be used to emulate forking
repositories a la github.

What follows is a very short howto, for the curious.  It assumes some
knowledge of basic gitolite usage only because I didn't want to make
this too lengthy; feel free to ask if needed.

Admin tasks (one time):

  * use the "pu" branch; the current tip is the commit called "(adc)
    documentation".  "adc" stands for "admin-defined commands"

  * install it, then edit `~/.gitolite.rc` on the server to
    uncomment/update the following lines as shown (or similar):

        $GL_WILDREPOS = 1;
        $GL_ADC_PATH = "/home/git/adc"; # or any convenient directory

  * copy the files from contrib/adc in the gitolite source to the above
    path on the server.

  * add the following lines to the default gitolite.conf that the
    install gives you:

        repo CREATER/.+
            C       =   @all
            RW+     =   CREATER
            RW      =   WRITERS
            R       =   @all

    All repos created now are public-readable by default.  Replace the
    "@all" in the last line with "READERS" if you want the repos to be
    private by default.

User tasks:

This is how users would use it, once their pubkeys have been added to
the keydir/ and pushed as usual.  We assume this is being done from
user "alice"'s account.

Creating a new repo on the server:

    git clone git at server:alice/foo
        # create and clone an empty repo to start working
    git push [--all] git at server:alice/foo [refspec]
        # or, create and push from an existing repo in one shot

Removing an existing repo that you no longer need (be careful!):

    ssh git at server rmrepo alice/foo

Listing all repos you have access to (will show yours as well as others'
repos that you have been given access to):

    ssh git at server expand [optional-pattern]

Forking user "bob"'s "bar" repo (assuming you have at least read access):

    ssh git at server fork bob/bar alice/bar

Setting permissions for a repo you own:

    ssh git at server setperms alice/bar
    RW bob
    R eve mallory
    <ctrl-d>

Getting permissions for a repo you own:

    ssh git at server getperms alice/bar
    # prints:
    RW bob
    R eve mallory

I'm rather pleased that, after a refactoring of the "query rights" code
that was useful by itself anyway, this feature only added about 25 lines
to the core code.  Many thanks to Eli for sparking this whole thing off.

If anyone else wants to help me test it, I'd very grateful.  Details at
http://github.com/sitaramc/gitolite/blob/pu/doc/admin-defined-commands.mkd

-- 
Sitaram
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


More information about the git-announce mailing list