I'm using Gitosis to administer some Git repositories on a remote server. Since I'm at the beginning with it, I make a lot of mistakes. That's why right now I need to delete a Git repository that I created with Gitosis. Is this possible using Gitosis or do I have to log into that machine and do it from there?
How to delete Git repository with Gitosis
git
Related Solutions
These days there is a "smart HTTP" upload feature, might even supersede the SSH access. No more private key generating is required, and installing should be easier, because the server component can be written in any language of choice:
- Running a Git server with IIS 7 and .NET 4: http://www.jeremyskinner.co.uk/2010/06/25/hosting-a-git-server-under-iis7-on-windows/ or http://github.com/yysun/Git-Web-Access
- Running a Git server via Python: http://github.com/dvdotsenko/git_http_backend.py
- Running a Git server via Python using git-http-backend : http://gitstack.com
- Running a Git server via Ruby: http://github.com/schacon/grack
If all fails, you can also choose to setup an Apache server, and use the standard git-http-backend
CGI binary, see: What are the steps to setup git-http-backend w/ Apache on Windows?
Gitosis uses gitweb for http publishing of repositories.
You need to have gitweb running.
Please ensure that gitweb is installed. Your gitweb.conf should look like:
# Location of the git binary
$GIT = "/usr/bin/git";
# Project root for gitweb
$projectroot = "/srv/git/repositories";
$stylesheet = "/gitweb.css";
$logo = "/git-logo.png";
$favicon = "/git-favicon.png";
# Site name
$site_name = "My site";
# URL formatting
#$my_uri = "http://git.somewhere.net/";
#$home_link = $my_uri;
# Base URL for project trees
@git_base_url_list = ("ssh://git\@somewhere.net");
# Length of the project description column in the webpage.
$projects_list_description_width = 50;
# Which repos are allowed to export
$export_ok = "git-daemon-export-ok";
# Enable PATH_INFO so the server can produce URLs of the
# form: http://git.hokietux.net/project.git/xxx/xxx
$feature{'pathinfo'}{'default'} = [1];
# Enable blame, pickaxe search, snapshop, search, and grep
$feature{'blame'}{'default'} = [1];
$feature{'blame'}{'override'} = [1];
$feature{'pickaxe'}{'default'} = [1];
$feature{'pickaxe'}{'override'} = [1];
$feature{'snapshot'}{'default'} = [1];
$feature{'snapshot'}{'override'} = [1];
$feature{'search'}{'default'} = [1];
$feature{'grep'}{'default'} = [1];
$feature{'grep'}{'override'} = [1];
Example gitweb config in apache:
Alias /gitweb/gitweb.css /usr/share/gitweb/gitweb.css
Alias /gitweb/git-logo.png /usr/share/gitweb/git-logo.png
Alias /gitweb/git-favicon.png /usr/share/gitweb/git-favicon.png
ScriptAlias /gitweb /usr/lib/cgi-bin/gitweb.cgi
<Directory /usr/share/gitweb>
Options FollowSymLinks +ExecCGI
AddHandler cgi-script .cgi
</Directory>
<Location /gitweb>
Order allow,deny
Allow from all
#AuthType Basic
#AuthName "GITOLITE"
#AuthUserFile /etc/apache2/gitweb.htpasswd
#Require valid-user
</Location>
# Securing with users example
<Location /gitweb/SomethingToHide.git>
Require user myusername
</Location>
I've switched to gitolite because...
- it is easier to use
- it has more options (security, grouping etc.)
Best Answer
Gitosis by itself does not have a remove function because of the way it is managed through git commits. If you remove the repository from the
gitosis.conf
and commit the change then the repository is no longer accessible. You can re-enable it later or you can eventually log into the server and remove the file from the gitosisrepositories/
directory.I cloned my
gitosis-admin.git
repository and added the following then committed:I then went to my home directory and performed the following:
This should successfully push to the server and then I wiped the
test1
directory away and clone it from gitosis:This should also push successfully as well so I then remove the
test1
line from thegitosis.conf
config and commit the change... I then try the following:Unlike the previous two pushes this one fails with the following error message:
The error is because gitosis does not have anything configured for the
test1
repository now. If you attempt to clone the repository again you will receive the same error.