This error occurs when Git cannot set up automated maintenance tasks with your system scheduler. Git maintenance uses platform-specific schedulers (systemd, cron, launchctl, or schtasks) to run repository optimization tasks, and this fails when the scheduler is unavailable or lacks permissions.
Git maintenance is a feature that automates repository optimization tasks like garbage collection, commit-graph updates, and loose object cleanup. When you run `git maintenance start`, Git attempts to register scheduled tasks with your operating system's task scheduler. This error indicates that Git could not successfully create or register these scheduled tasks with the system scheduler. The `git maintenance` command tries to use the most appropriate scheduler for your platform: systemd timers on modern Linux systems, cron on POSIX systems, launchctl on macOS, and Task Scheduler (schtasks) on Windows. The failure typically occurs when the scheduler is not installed, not running, or when Git lacks the necessary permissions to create scheduled tasks. This is a setup error rather than a runtime error - it prevents the automated maintenance from being scheduled but does not affect your ability to use Git normally or run maintenance manually.
Check what scheduler Git will attempt to use on your system:
git maintenance start --scheduler=autoFor more control, explicitly specify the scheduler:
# On Linux with systemd
git maintenance start --scheduler=systemd-timer
# On Linux/Unix with cron
git maintenance start --scheduler=crontab
# On macOS
git maintenance start --scheduler=launchctl
# On Windows
git maintenance start --scheduler=schtasksThis helps identify if the issue is with a specific scheduler.
Verify the scheduler service is available on your system.
For Linux with systemd:
# Check if systemd user services are enabled
systemctl --user status
# List existing timers
systemctl --user list-timersFor cron:
# Check if cron is installed
which cron || which crond
# Check if cron service is running
systemctl status cron # Debian/Ubuntu
systemctl status crond # RHEL/CentOS
# Verify you can access crontab
crontab -lFor Windows:
Open Task Scheduler (taskschd.msc) and verify the service is running.
For macOS:
# Check launchctl status
launchctl list | grep gitIf the scheduler is not installed, install it using your package manager.
Debian/Ubuntu:
sudo apt update
sudo apt install cron
sudo systemctl enable --now cronRHEL/CentOS/Fedora:
sudo dnf install cronie
sudo systemctl enable --now crondArch Linux:
sudo pacman -S cronie
sudo systemctl enable --now cronieFor systemd-based systems, ensure user services are enabled:
systemctl --user enable --now systemd-tmpfiles-setup.serviceVerify you have permission to create crontab entries:
# Check if cron.deny exists and contains your username
cat /etc/cron.deny 2>/dev/null | grep $(whoami)
# Check if cron.allow exists (if it does, your user must be listed)
ls -la /etc/cron.allowIf you are blocked by cron.deny, ask your system administrator to remove the restriction, or add your user to cron.allow:
echo "$(whoami)" | sudo tee -a /etc/cron.allowOn systemd-based Linux systems, enable user service lingering so timers persist after logout:
# Enable lingering for your user
sudo loginctl enable-linger $(whoami)
# Verify lingering is enabled
loginctl show-user $(whoami) | grep LingerThen try setting up maintenance again:
git maintenance start --scheduler=systemd-timerClear any partial or corrupted maintenance configuration:
# Stop and unregister maintenance
git maintenance unregister --force
git maintenance stop
# Remove maintenance config
git config --unset maintenance.strategy
git config --unset maintenance.auto
# For systemd, manually remove timer units if they exist
rm -f ~/.config/systemd/user/git-maintenance@*.timer
rm -f ~/.config/systemd/user/git-maintenance@*.service
systemctl --user daemon-reload
# For cron, manually remove entries
crontab -l | grep -v git-maintenance | crontab -
# Try again
git maintenance startIf you cannot resolve the scheduler issue, you can still benefit from maintenance by running it manually:
# Run all maintenance tasks now
git maintenance run
# Run specific tasks
git maintenance run --task=gc
git maintenance run --task=commit-graph
git maintenance run --task=prefetchYou can create your own scheduled task using your preferred method (cron, systemd timer, Task Scheduler) to run git maintenance run periodically.
On Linux systems, Git prefers systemd timers over cron when available because systemd provides better logging (via journald), service isolation (cgroups), and persistence (timers run on next boot if missed). If you want to force cron usage even when systemd is available, use --scheduler=crontab.
The default maintenance strategy includes three frequencies: hourly (prefetch), daily (commit-graph, loose-objects), and weekly (pack-refs, incremental-repack). You can customize which tasks run and their frequency by editing the Git config after setup.
On Windows, the scheduled tasks run as console applications that create visible windows. To hide these windows, open Task Scheduler, locate the "Git Maintenance" tasks, edit them, and select "Run whether user is logged on or not" (requires password authentication).
For CI/CD environments or shared servers, consider running git maintenance run as part of your deployment scripts rather than relying on user-level scheduled tasks. Repository maintenance can also be configured globally across all repos using git config --global maintenance.strategy incremental.
If you are using WSL (Windows Subsystem for Linux), be aware that systemd support varies by WSL version. WSL2 with recent distributions supports systemd, but older setups may require cron.
warning: BOM detected in file, this may cause issues
UTF-8 Byte Order Mark (BOM) detected in file
fatal: Server does not support --shallow-exclude
Server does not support --shallow-exclude
warning: filtering out blobs larger than limit
Git partial clone filtering large blobs warning
fatal: Server does not support --shallow-since
Server does not support --shallow-since in Git
kex_exchange_identification: Connection closed by remote host
Connection closed by remote host when connecting to Git server