A complete, production-ready Git management interface for Laravel applications. Manage your repository through a beautiful web interface without ever touching the terminal.
- Add, Commit, Push, Pull, Fetch - All basic Git operations
- Branch Management - Create, switch, merge, and delete branches
- Stash Operations - Stash and apply changes
- Reset & Revert - Undo changes safely
- Status Monitoring - Real-time repository status
- Custom Git Commands - Execute any git command
- Custom Artisan Commands - Run Laravel commands
- Real-time Output Console - See command results instantly
- Branch Switcher - Quick branch navigation
- Commit History - View recent commits
- File Diff Viewer - Check file differences
- Password Protection - Secure access with bcrypt hashed passwords
- Session Management - Configurable session timeout
- Dangerous Command Blocking - Prevents destructive commands
- CSRF Protection - All requests protected
- IP Whitelisting - Optional IP restrictions
- Beautiful UI - Modern, responsive design with Tailwind CSS
- Standalone Layout - No dependencies on your app's layout
- Real-time Updates - Live status and branch information
- Keyboard Shortcuts - Ctrl+Enter to commit quickly
- Dark Console - Terminal-style output display
- PHP 7.4 or higher
- Laravel 8.x, 9.x, 10.x, or 11.x
- Git installed on server
- Composer
composer require ahmedhsieb/laravel-git-managerThe package will be automatically discovered by Laravel.
php artisan git-manager:setupThe interactive setup wizard will ask you for:
- Git Username - Your GitHub/GitLab/Bitbucket username
- Personal Access Token - Your Git provider token
- User Name - Name that appears in commits
- User Email - Email that appears in commits
- Access Password - Password to protect the web interface
- Go to https://github.com/settings/tokens
- Click "Generate new token (classic)"
- Give it a name: "Laravel Git Manager"
- Select scopes: β
repo(Full control of private repositories) - Click "Generate token"
- Copy the token (save it - you won't see it again!)
- Go to https://gitlab.com/-/profile/personal_access_tokens
- Create new token
- Select scopes:
api,read_repository,write_repository - Create and copy the token
- Go to https://bitbucket.org/account/settings/app-passwords/
- Create app password
- Select permissions: Repositories (Read, Write, Admin)
- Create and copy the password
Visit: http://your-domain.com/git-manager
Login with the password you set during setup.
- Click "Pull" to get latest changes
- Make your code changes
- Type a commit message
- Click "Add + Commit + Push"
- Create Branch: Type branch name β Click "Create & Checkout"
- Switch Branch: Click any branch in the sidebar
- Merge Branch: Type branch name β Click "Merge"
Execute any git command:
status -s
log --oneline -10
branch -a
remote -v
Execute any artisan command:
cache:clear
migrate:status
queue:work --once
# Update any setting
php artisan git-manager:config
# Update specific setting
php artisan git-manager:config username
php artisan git-manager:config password
php artisan git-manager:config tokenphp artisan route:list | grep git-managerphp artisan vendor:publish --tag=git-manager-configThis creates config/git-manager.php where you can customize:
return [
'username' => env('GIT_MANAGER_USERNAME', ''),
'token' => env('GIT_MANAGER_TOKEN', ''),
'user_name' => env('GIT_MANAGER_USER_NAME', ''),
'user_email' => env('GIT_MANAGER_USER_EMAIL', ''),
'access_password' => env('GIT_MANAGER_PASSWORD', ''),
'session_duration' => env('GIT_MANAGER_SESSION_DURATION', 120), // minutes
'route_prefix' => env('GIT_MANAGER_ROUTE_PREFIX', 'git-manager'),
'middleware' => ['web'],
'timeout' => env('GIT_MANAGER_TIMEOUT', 300), // seconds
];Add to your .env file:
GIT_MANAGER_USERNAME=your-github-username
GIT_MANAGER_TOKEN=ghp_your_token_here
GIT_MANAGER_USER_NAME="Your Full Name"
GIT_MANAGER_USER_EMAIL=your@email.com
GIT_MANAGER_PASSWORD=your_hashed_password
GIT_MANAGER_SESSION_DURATION=120
GIT_MANAGER_ROUTE_PREFIX=git-manager
GIT_MANAGER_TIMEOUT=300Change the URL prefix in .env:
GIT_MANAGER_ROUTE_PREFIX=admin/gitAccess at: http://your-domain.com/admin/git
Add authentication or other middleware:
// config/git-manager.php
'middleware' => ['web', 'auth', 'admin'],To customize the views:
php artisan vendor:publish --tag=git-manager-viewsViews will be published to resources/views/vendor/git-manager/
The interface is protected by a password set during setup. Passwords are bcrypt hashed and never stored in plain text.
Sessions expire after 2 hours (configurable). Users must login again after expiration.
Add IP restrictions by modifying your routes:
// routes/web.php
Route::prefix(config('git-manager.route_prefix'))
->middleware(function ($request, $next) {
$allowedIps = ['127.0.0.1', 'your.server.ip'];
if (!in_array($request->ip(), $allowedIps)) {
abort(403);
}
return $next($request);
})
->group(function () {
// Git Manager routes
});Dangerous commands like rm, clean -fd, and reset --hard HEAD~ are blocked automatically.
All endpoints require authentication via password-protected session.
GET /git-manager/status- Repository statusGET /git-manager/current-branch- Current branchGET /git-manager/branches- List all branchesGET /git-manager/log?limit=10- Commit history
POST /git-manager/add- Stage filesPOST /git-manager/commit- Commit changesPOST /git-manager/push- Push to remotePOST /git-manager/pull- Pull from remotePOST /git-manager/fetch- Fetch from remote
POST /git-manager/checkout- Switch branchPOST /git-manager/branch/create- Create branchPOST /git-manager/merge- Merge branchDELETE /git-manager/branch/delete- Delete branch
POST /git-manager/custom- Execute custom git commandPOST /git-manager/artisan- Execute artisan commandPOST /git-manager/full-push- Add + Commit + Push
Run the setup command:
php artisan git-manager:setup- Check token is valid: Visit GitHub β Settings β Tokens
- Verify token has
reposcope - Update token:
php artisan git-manager:config token
Configure git user:
php artisan git-manager:config user_name
php artisan git-manager:config user_emailOr manually:
git config --global user.name "Your Name"
git config --global user.email "your@email.com"Give web server write access:
# Linux/Unix
sudo chown -R www-data:www-data /path/to/repo
sudo chmod -R 775 /path/to/repo/.git
# Or for nginx
sudo chown -R nginx:nginx /path/to/repoIncrease timeout in .env:
GIT_MANAGER_TIMEOUT=600Clear cache:
php artisan view:clear
php artisan cache:clear
php artisan config:clearClear route cache:
php artisan route:clear
composer dump-autoloadUse clear, descriptive commit messages:
feat: Add user authentication
fix: Resolve login issue
docs: Update README
style: Format code
refactor: Simplify validation logic
Follow a consistent naming convention:
feature/new-feature
bugfix/issue-123
hotfix/critical-fix
release/v1.0.0
- Always pull before starting work
- Create a feature branch for new work
- Commit frequently with clear messages
- Push regularly to backup your work
- Merge when feature is complete
- Always pull before pushing
- Review changes before committing
- Use stash when switching branches with uncommitted changes
- Be careful with reset --hard
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This package is open-sourced software licensed under the MIT license.
Ahmed Osama
- Email: AhmedOsama11702@gmail.com
- GitHub: @ahmedhsieb
- Built with Laravel
- UI powered by Tailwind CSS
- Icons by Font Awesome
If you have any feedback, please reach out to me at AhmedOsama11702@gmail.com
If you find this package helpful, please consider giving it a β on GitHub!