Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions README

This file was deleted.

21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# cgit. git CGI interface

`cgit` lets you control a git repository using HTTP get calls.

## Prerequisites
- git
- a web server

## Installation
1. Make a directory for your project (DocumentRoot)
2. Set chmod 777 for the empty directory
3. `git clone git://github.com/slim/cgit.git` in the root directory
4. Init your project tree using cgit by browsing to `server-url/cgit/?init`

## Usage
Command format is :
```PLAIN
server-url/cgit/?<command>=<arguments>&<command>=<arguments>&...
```

Where the `<command>` parameter is any one of `push`, `pull`, `commit`, `checkout`, etc. and `<arguments>` are the arguments for the specified command.
5 changes: 2 additions & 3 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
foreach ($_GET as $command => $arguments) {
passthru("cd .. && git $command $arguments 2>&1");
}
$timeStamp = date('c');
$logEntry = "<code time='$timeStamp'>". json_encode($_GET) . json_encode($_POST) ."</code>";
file_put_contents('../cgit.log', $logEntry, FILE_APPEND);
$logEntry = date('c') . " | " . json_encode($_GET) . json_encode($_POST) ."\n";
file_put_contents('cgit.log', $logEntry, FILE_APPEND);
?>
</pre>