User Tools

  • Logged in as: anonymous (anonymous)
  • Log Out

Site Tools


mantisbt:gitosis_management

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
mantisbt:gitosis_management [2008/11/05 15:00] – Adding a new repo. jreesemantisbt: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 ''post-update'' hook in the ''gitosis-admin'' repository;  in other words, every time you push changes to the special repository, it automatically updates all the appropriate settings, files, etc on the server to match the new configuration. Gitosis does its magic via the ''post-update'' hook in the ''gitosis-admin'' repository;  in other words, every time you push changes to the special repository, it automatically updates all the appropriate settings, files, etc on the server to match the new configuration.
 +
 +==== Clone and Push URL's ====
 +
 +All repositories hosted by Gitosis have a "private" clone and push URL, which is used for authenticated, read/write access to the repository:
 +
 +<code>git@mantisbt.org:<repository>.git</code>
 +
 +Public repositories have a separate clone URL that uses an unauthenticated connection to allow cloning the repository without any permissions check:
 +
 +<code>git://mantisbt.org/<repository>.git</code>
  
 ==== Repository Layout ==== ==== Repository Layout ====
Line 46: Line 56:
 ==== Adding a New Repository ==== ==== Adding a New Repository ====
  
-For this section, we'll assume you want to create a new repository named ''mantis-plugin'', and give write access to the repository owner ''jsmith'' and the core developer group ''core'' You will want to replace the repository, user, or group names as appropriate.+For this section, we'll assume you want to create a new repository named ''myplugin'', and give write access to the repository owner ''jsmith'' and the core developer group ''core'' You will want to replace the repository, user, or group names as appropriate.
  
 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. 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.
Line 56: Line 66:
 Edit ''gitosis.conf'' and add a section to the end of the file with the following contents: Edit ''gitosis.conf'' and add a section to the end of the file with the following contents:
 <code> <code>
-[repo mantis-plugin]+[repo myplugin]
 description = A plugin for the Mantis Bug Tracker. description = A plugin for the Mantis Bug Tracker.
 owner = John Smith owner = John Smith
  
-[group mantis-plugin+[group myplugin
-writable = mantis-plugin+writable = myplugin
 members = jsmith @core members = jsmith @core
 </code> </code>
Line 78: Line 88:
 <code> <code>
 $ git add gitosis.conf keydir/jsmith.pub $ git add gitosis.conf keydir/jsmith.pub
-$ git commit -m "Added 'mantis-plugin' repository and 'jsmith' user."+$ git commit -m "Added 'myplugin' repository and 'jsmith' user."
  
 $ git pull --rebase    # make sure we have the latest updates from the server $ git pull --rebase    # make sure we have the latest updates from the server
Line 84: Line 94:
 </code> </code>
  
-Congratulations!  Your new repository is now configured through Gitosis.  Your next step is to push an existing Git checkout/clone to the new repository URL:+Congratulations!  Your new repository is now configured through Gitosis.  Note that you will get an error that the repository doesn't exist.  Your next step is to push an existing Git checkout/clone to the new repository URL:
  
 <code> <code>
-$ cd /path/to/mantis-plugin +$ cd /path/to/myplugin 
-$ git remote add origin git@mantisbt.org:mantis-plugin.git+$ git remote rm origin 
 +$ git remote add origin git@mantisbt.org:myplugin.git
 $ git push origin master $ git push origin master
 </code> </code>
  
 You're done! You're done!
 +
 +==== Making a Repository Public ====
 +
 +We'll assume the same repository name of ''myplugin'', and that we want the repository to be publicly available without authentication, and viewable on the web via gitweb.  You'll need to have root access on the server to perform these steps.
 +
 +First, we need to open up permissions on the repository directory so that all users have read and execute permissions:
 +
 +<code>
 +# sudo chmod 755 ~git/repositories/myplugin.git
 +</code>
 +
 +Next we need to symlink to the repository from a location where git-daemon and gitweb are both looking for shared repos:
 +
 +<code>
 +# sudo ln -s ~git/repositories/myplugin.git /var/cache/git/
 +</code>
 +
 +Congratulations!  You can view the repository with gitweb at a URL similar to http://git.mantisbt.org/?p=myplugin.git, and users can clone the repository from the URL git://mantisbt.org/myplugin.git
 +
 +Remember: git:// only provides read access to the repository.  Developers will still need to clone from ''git@mantisbt.org:myplugin.git'' in order to be able to push changes back to the server.
  
 ===== References ===== ===== References =====
mantisbt/gitosis_management.1225915211.txt.gz · Last modified: 2008/11/05 15:19 (external edit)

Driven by DokuWiki