The GitPHP guide 🚀
Comprehensive open-source documentation: Self-hosting, Personal Access Tokens, Git & SSH, pull requests, and REST API.
📑
All
📦
📦 Installation
🚀
🚀 Remote Updates & Downloads
NEW
🔑
⭐️ Token Push
🚀
🚀 Quick Start
💻
💻 Git & SSH
🔀
🔀 Pull Requests
📁
📁 Features
⚡️
⚡️ REST API
🛡️
🛡️ Admin & Security
🔧
🔧 Troubleshooting
10 Webhooks
Under repository settings → Webhooks, register HTTP endpoints to receive real-time JSON payloads for events:
push— Pushes and branch creations/deletions.issues— Issue creation, comments, and state changes.pull_request— PR opening, review approvals, and merges.release— Release publications.
When configured with a Secret Key, payloads are HMAC-SHA256 signed in the X-GitPHP-Signature header.
⚡️ REST API Documentation
v1
11 REST API v1 Documentation ⚡️
A comprehensive RESTful API is provided for automation and integrations. Authenticate using personal access tokens (gtp_…) via Authorization: Bearer or X-GitPHP-Token headers.
1. Request Headers
# Standard Bearer Authentication:
Authorization: Bearer gtp_your_token_here
# Or custom header:
X-GitPHP-Token: gtp_your_token_here
2. Authenticated User Identity (Whoami)
curl -H "Authorization: Bearer gtp_your_token" \
https://git.ysnapp.com/api/v1/user
3. Repository Metadata
curl -H "Authorization: Bearer gtp_your_token" \
https://git.ysnapp.com/api/v1/repos/my-project
4. Commits History (Paginated)
curl -H "Authorization: Bearer gtp_your_token" \
"https://git.ysnapp.com/api/v1/repos/my-project/commits?ref=main&page=1&per_page=10"
5. Tree Browsing & Blob Content (Base64)
# Directory Tree
curl -H "Authorization: Bearer gtp_your_token" \
"https://git.ysnapp.com/api/v1/repos/my-project/tree?ref=main&path=src"
# File Blob Content
curl -H "Authorization: Bearer gtp_your_token" \
"https://git.ysnapp.com/api/v1/repos/my-project/blob?ref=main&path=README.md"
| Endpoint | Description | Query Parameters |
|---|---|---|
GET /api/v1/user | Token owner identity & scopes | — |
GET /api/v1/repos/{slug} | Repository metadata | — |
GET /api/v1/repos/{slug}/branches | Branch list with commit SHAs | — |
GET /api/v1/repos/{slug}/tags | Tags and releases list | — |
GET /api/v1/repos/{slug}/commits | Paginated commit log | ref, page, per_page |
GET /api/v1/repos/{slug}/tree | Directory tree browsing | ref, path |
GET /api/v1/repos/{slug}/blob | File contents (Base64) | ref, path |
GET /api/v1/repos/{slug}/issues | Issues list and state | state=open|closed|all |
GET /api/v1/repos/{slug}/pulls | Pull requests and review status | state=open|closed|all |
📖 Full markdown documentation is available at:
docs/api.md.