mantisbt:gitosis_management
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
mantisbt:gitosis_management [2008/11/05 14:29] – General process. jreese | mantisbt:gitosis_management [2008/11/07 02:16] (current) – Added steps to mitigate errors I got + renamed to myplugin. vboctor | ||
---|---|---|---|
Line 8: | Line 8: | ||
Gitosis does its magic via the '' | Gitosis does its magic via the '' | ||
+ | |||
+ | ==== Clone and Push URL's ==== | ||
+ | |||
+ | All repositories hosted by Gitosis have a " | ||
+ | |||
+ | < | ||
+ | |||
+ | Public repositories have a separate clone URL that uses an unauthenticated connection to allow cloning the repository without any permissions check: | ||
+ | |||
+ | < | ||
+ | |||
+ | ==== Repository Layout ==== | ||
+ | |||
+ | The '' | ||
+ | |||
+ | gitosis-admin/ | ||
+ | gitosis.conf | ||
+ | keydir/ | ||
+ | jreese.pub | ||
+ | .... | ||
+ | |||
+ | The file '' | ||
+ | |||
+ | Because Git/Gitosis relies on SSH access for users to push changes to repositories, | ||
===== Repository Management ===== | ===== Repository Management ===== | ||
Line 29: | Line 53: | ||
Gitosis will then handle updating all the repositories appropriately. | Gitosis will then handle updating all the repositories appropriately. | ||
+ | |||
+ | ==== Adding a New Repository ==== | ||
+ | |||
+ | For this section, we'll assume you want to create a new repository named '' | ||
+ | |||
+ | By default, all new repositories remain private, meaning that only the users you grant explicit read/write access through Gitosis will be able to interact with it. We'll cover how to make a private repository public later. | ||
+ | |||
+ | < | ||
+ | $ cd gitosis-admin | ||
+ | </ | ||
+ | |||
+ | Edit '' | ||
+ | < | ||
+ | [repo myplugin] | ||
+ | description = A plugin for the Mantis Bug Tracker. | ||
+ | owner = John Smith | ||
+ | |||
+ | [group myplugin] | ||
+ | writable = myplugin | ||
+ | members = jsmith @core | ||
+ | </ | ||
+ | |||
+ | Notice that both the repo and the new group share the same name so that their relation is obvious when looking at the file. Also of note is that the '' | ||
+ | |||
+ | If the user '' | ||
+ | < | ||
+ | $ cat > keydir/ | ||
+ | ... | ||
+ | ^D | ||
+ | </ | ||
+ | |||
+ | Now you need to add and commit your changes to the repository, and then push your commit back to the server: | ||
+ | |||
+ | < | ||
+ | $ git add gitosis.conf keydir/ | ||
+ | $ git commit -m "Added ' | ||
+ | |||
+ | $ git pull --rebase | ||
+ | $ git push | ||
+ | </ | ||
+ | |||
+ | Congratulations! | ||
+ | |||
+ | < | ||
+ | $ cd / | ||
+ | $ git remote rm origin | ||
+ | $ git remote add origin git@mantisbt.org: | ||
+ | $ git push origin master | ||
+ | </ | ||
+ | |||
+ | You're done! | ||
+ | |||
+ | ==== Making a Repository Public ==== | ||
+ | |||
+ | We'll assume the same repository name of '' | ||
+ | |||
+ | First, we need to open up permissions on the repository directory so that all users have read and execute permissions: | ||
+ | |||
+ | < | ||
+ | # sudo chmod 755 ~git/ | ||
+ | </ | ||
+ | |||
+ | Next we need to symlink to the repository from a location where git-daemon and gitweb are both looking for shared repos: | ||
+ | |||
+ | < | ||
+ | # sudo ln -s ~git/ | ||
+ | </ | ||
+ | |||
+ | Congratulations! | ||
+ | |||
+ | Remember: git:// only provides read access to the repository. | ||
===== References ===== | ===== References ===== | ||
[1] http:// | [1] http:// | ||
+ | |||
+ | [0] Gitosis '' | ||
+ | < | ||
+ | # this config file tries to show a bit of everything, most real life | ||
+ | # configurations really only need a " | ||
+ | # " | ||
+ | |||
+ | [gitosis] | ||
+ | |||
+ | [group quux] | ||
+ | members = jdoe wsmith @anothergroup | ||
+ | writable = foo bar baz/thud | ||
+ | readonly = xyzzy | ||
+ | |||
+ | ## You can use groups just to avoid listing users multiple times. Note | ||
+ | ## no writable= or readonly= lines. | ||
+ | [group anothergroup] | ||
+ | members = alice bill | ||
+ | |||
+ | ## You can play fancy tricks by making some repositories appear with | ||
+ | ## different names in different contexts. Not really supported | ||
+ | ## everywhere (e.g. gitweb) and can be confusing -- experts only. | ||
+ | map writable visiblename1 = actualname1 | ||
+ | map readonly visiblename2 = actualname2 | ||
+ | |||
+ | [repo foo] | ||
+ | ## Oneline description of the project, mostly for gitweb. | ||
+ | description = blah blah | ||
+ | |||
+ | ## Owner of this repository. Used in gitweb list of projects. | ||
+ | owner = John Doe | ||
+ | |||
+ | </ |
mantisbt/gitosis_management.1225913378.txt.gz · Last modified: 2008/11/05 14:37 (external edit)