Sync Error Handling

Sub-skill of sync: Error Handling.

vamseeachanta 2c51fca 794 B Updated

File contents

Error Handling

Error Handling

Detached HEAD

cd "$WORKSPACE_ROOT/$repo"
git checkout main 2>/dev/null || git checkout master
git pull --rebase origin main

Diverged History (force-pushed remote)

# Detect: behind > 0 AND ahead > 0
# DO NOT auto-resolve — ask user:
echo "$repo has diverged: $BEHIND behind, $AHEAD ahead"
echo "Options: merge, reset --hard origin/main, or skip"

Stash Pop Conflict

# Report to user, do NOT auto-resolve
echo "Stash pop conflict in $repo — manual resolution required"
git stash list

CRLF / Line Ending Issues

# Fix shell scripts to LF
git config core.autocrlf input
# Or per-file: dos2unix script.sh

vamseeachanta/workspace-hub/tree/main/.agents/skills/_archive/workspace-hub/sync/error-handling commit 2c51fcafdc

Frequently asked questions

npx skillmds@latest add vamseeachanta/sync-error-handling