A cross-platform Git hook implementation that automatically tracks developer activity and sends it to a centralized monitoring system.
This repository contains a post-commit hook that tracks developer activities across Windows, macOS, and Linux platforms. The hook captures essential information about commits and reports them to a Laravel-based API endpoint.
- Git (any recent version)
- Either curl or wget installed
- Bash shell (Git Bash on Windows)
-
Copy the post-commit hook to your repository's hooks directory:
cp post-commit .git/hooks/
-
Set proper permissions (Unix/Linux/macOS):
chmod +x .git/hooks/post-commit
-
Configure your MIS credentials in the post-commit hook:
AUTH_USER="[email protected]" AUTH_PASS="your-mis-password"
The hook works across:
- Windows (including Git Bash, Cygwin, MSYS2)
- macOS
- Linux
- Unix-like systems
The hook tracks:
- Developer name and email
- Repository URL
- Branch name
- Commit URL
- Commit message
- Activity type
- Platform information
The hook sends data to: https://mis.softpyramid.com.pk/api/log-activity
-
Install Husky:
npm install husky --save-dev
-
Initialize Husky:
npx husky install
-
Add the post-commit hook:
npx husky add .husky/post-commit "bash post-commit"
- Ensure Git Bash is installed
- Use forward slashes (/) in paths
- Check if curl/wget is accessible
- Verify execute permissions
- Ensure bash is available at /usr/bin/env bash
- Uses Basic Authentication
- Requires valid MIS credentials
- Communicates over HTTPS
- Handles sensitive data safely
For any issues or questions, please contact SOFT PYRAMID LLC.
Developed by SOFT PYRAMID LLC