Commit Graph

2 Commits

Author SHA1 Message Date
a01771fa4d fix: handle corrupted .gitconfig file permissions
- Remove corrupted /var/www/.gitconfig file
- Create fresh .gitconfig with correct owner (www-data)
- Set proper permissions (600) before git config commands
- This prevents 'could not lock config file' permission errors
2026-08-04 03:06:41 +05:30
9156bb2ebd improve: comprehensive git diagnostics and automated setup script
Enhanced error reporting:
- Show detailed diagnostic information: git version, user config, email, remote, branch
- Check .git directory and config file existence
- Detect if repository has uncommitted changes
- Error categorization: PERMISSION, CONFIG, REPO, NETWORK, SSL, GIT errors
- Actionable error messages with command suggestions
- Report raw error output to log file for debugging

Added setup_git_config.sh script:
- Automated configuration for www-data user
- Creates .ssh directory with proper permissions
- Sets git user.name and user.email globally
- Disables SSL verification (for HTTPS repos)
- Configures git to use HTTPS remote URL
- Fixes directory ownership and permissions
- Tests git status to verify configuration

Usage on live server:
  sudo bash setup_git_config.sh

This script handles the common git configuration issues
that prevent 'Update HMS' button from working.
2026-08-04 03:04:53 +05:30