Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

git-service-lite

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

git-service-lite

A lightweight Node.js Git HTTP service for single‑user scenario

latest
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

git-service-lite

A lightweight Node.js Git HTTP service designed for single‑user scenario. It provides a simple HTTP interface to interact with local Git repositories, making it ideal when a full‑featured Git server would be unnecessary.

Features

  • Clone, fetch, push, and pull over HTTP (default access limited to the service host IP)
  • Basic authentication using a randomly generated key
  • Configurable repository root directory
  • Uses the local user's Git configuration for committing (name & email)

Installation

npm install -g git-service-lite

Quick Start

Example: Linux (bash)

# Create a directory to store your repositories
mkdir -p ~/git-repos
cd ~/git-repos

# Create a group folder and initialize a bare repository
mkdir -p ./my-project-group
cd ./my-project-group
git init --bare my-project.git

# Start the service (default port 3000)
GIT_SERVICE_REPOSITORIES_ROOT=~/git-repos git-service

Example: Windows (PowerShell)

# Create a directory to store your repositories
New-Item -ItemType Directory -Path "$HOME\git-repos" -Force
Set-Location "$HOME\git-repos"

# Create a group folder and initialize a bare repository
New-Item -ItemType Directory -Path ".\my-project-group" -Force
Set-Location ".\my-project-group"
git init --bare my-project.git

# Start the service (default port 3000)
$env:GIT_SERVICE_REPOSITORIES_ROOT = "$HOME\git-repos"
git-service

The service will now listen on http://localhost:3000. You can clone the repository with:

git clone http://localhost:3000/git/my-project-group/my-project.git

Usage

Run the service with the following environment variables. All variables are optional; defaults are shown in the table.

Environment VariableTypeDefaultDescription
LOG_LEVELstringdebugLog output level. Options: error, warn, info, debug. Affects both console and file logs.
LOG_FILE_PATHstring(empty)Full path to the log file. If omitted and ENABLE_CONSOLE_LOG is off, the service will fail to start because there is no log destination.
ENABLE_CONSOLE_LOGstringon (equivalent to true)Set to any value other than on to disable console logging.
GIT_REPOSITORIES_ROOTstring./repos (relative to the user's home directory)Root directory for all managed Git repositories. All repositories must reside under this directory.
GIT_SERVICE_ADDRESSstring127.0.0.1IP address the service binds to.
GIT_SERVICE_PORTstring3000TCP port the service listens on.
GIT_SERVICE_BASE_URLstringAuto‑generated from GIT_SERVICE_ADDRESS and GIT_SERVICE_PORTPublic base URL (e.g., http://localhost:3000). Override to force http or https.
GIT_SERVICE_ALLOWED_REQUEST_ADDRESS_LISTstring<GIT_SERVICE_ADDRESS>Whitelist of IPs allowed to access the service, separated by semicolons (;). Example: 192.168.0.101;192.168.0.102.
GIT_SERVICE_KEY_UPDATE_TIMESPANstring86400 (seconds)Interval for regenerating the service’s certificate, in seconds.
GIT_COMMITTER_NAMEstringRead from ~/.gitconfig or must be provided manuallyName used for Git commits. If empty, a ConfigError is thrown.
GIT_COMMITTER_EMAILstringRead from ~/.gitconfig or must be provided manuallyEmail used for Git commits. If empty, a ConfigError is thrown.
GIT_COMMITTER_SECRETstring(empty)Secret used for authenticating access to the service. If this variable is left empty or deemed insecure, a random secret will be generated automatically.

Example: Linux (bash)

export LOG_LEVEL=info
export LOG_FILE_PATH=/var/log/git-service.log
export ENABLE_CONSOLE_LOG=off
export GIT_REPOSITORIES_ROOT=/srv/git-repos
export GIT_SERVICE_ADDRESS=192.168.0.100
export GIT_SERVICE_PORT=8080
export GIT_SERVICE_ALLOWED_REQUEST_ADDRESS_LIST=192.168.0.101;192.168.0.102   # The service host address (192.168.0.100) is added by default
export GIT_SERVICE_KEY_UPDATE_TIMESPAN=43200   # 12 hours
export GIT_COMMITTER_NAME="Qfield"
export GIT_COMMITTER_EMAIL="contact@qfield.net"

Example: Windows (PowerShell)

$env:LOG_LEVEL = "info"
$env:LOG_FILE_PATH = "C:\Logs\git-service.log"
$env:ENABLE_CONSOLE_LOG = "off"
$env:GIT_REPOSITORIES_ROOT = "D:\git-repos"
$env:GIT_SERVICE_ADDRESS = "192.168.0.100"
$env:GIT_SERVICE_PORT = "8080"
$env:GIT_SERVICE_ALLOWED_REQUEST_ADDRESS_LIST = "192.168.0.101;192.168.0.102"
$env:GIT_SERVICE_KEY_UPDATE_TIMESPAN = "43200"
$env:GIT_COMMITTER_NAME = "Qfield"
$env:GIT_COMMITTER_EMAIL = "contact@qfield.net"

Safe Mode

The --safe flag can be used to verify all repositories under the configured root directory before starting the service. It runs git fsck on each repository and exits with a non‑zero status if any errors are found.

git-service --safe

Keywords

git

FAQs

Package last updated on 12 Oct 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts