@danipatko/express-git
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

express-git

Express middleware that handles git requests using the git-http-backend CGI script.

Example

import ServeGit from '@danipatko/express-git';
import express from 'express';
const app = express();

const config = {
    host: '0.0.0.0',
    port: 3000,
    projectRoot: '/path/to/your/projects/',
};

app.use('/git', ServeGit(config));

app.listen(3000, '0.0.0.0', () => console.log('Server is listening...'));

Usage

# Create new repository in your configured projectRoot folder
mkdir example.git # name ends with '.git'
cd example.git
git init --bare # --initial-branch=master --template=<template>

# Enable pushing/modifying for anonymus users in this repo (manage access on the express server)
echo -e "[http]\n\treceivepack = true" >> config

# Clone the repo somewhere else
git clone http://127.0.0.1:3000/git/example.git
> Cloning into 'example'...
> warning: You appear to have cloned an empty repository.
# do stuff with the repo

Readme

Keywords

Package Sidebar

Install

npm i @danipatko/express-git

Weekly Downloads

1

Version

1.0.5

License

ISC

Unpacked Size

7.73 kB

Total Files

5

Last publish

Collaborators

  • danipatko