Runs a continuous pull and push loop in the background for Git repositories to keep a local branch synchronized with remote branches. This helps ensure that new worktrees based off of main are more up to date.
The sync loop periodically executes:
git pull --ff-only <pull-from-remote> <pull-from-branch>git push <push-to-remote> HEAD:<push-to-branch>SIGUSR1 signal.The synchronization script is located at: scripts/sync_git_branch_continuously.py under this skill directory.
To start the continuous sync script as a background daemon process:
# Sync active branch with tracking remote every 60s (default): REPO_NAME=$(basename "$(git rev-parse --show-toplevel 2>/dev/null || pwd)") BRANCH_NAME=$(git branch --show-current 2>/dev/null || echo "default") ./.agents/skills/sync-git-branch-continuously/scripts/\ sync_git_branch_continuously.py \ > "/tmp/sync_git_${REPO_NAME}_${BRANCH_NAME}.log" 2>&1 &
--pull-from-branch <name>: Remote branch to pull from (defaults to active branch).--push-to-branch <name>: Remote branch to push to (defaults to active branch).--pull-from-remote <name>: Remote repository to pull from (defaults to tracking remote or origin).--push-to-remote <name>: Remote repository to push to (defaults to tracking remote or origin).--interval <seconds>: Sleep interval between sync iterations (default: 60 seconds).Example with custom source and target destinations:
./.agents/skills/sync-git-branch-continuously/scripts/\ sync_git_branch_continuously.py \ --pull-from-remote upstream --pull-from-branch main \ --push-to-remote origin --push-to-branch feature \ --interval 30 \ > "/tmp/sync_git_main.log" 2>&1 &
Other processes or agent conversations can asynchronously wake up the daemon and trigger an immediate pull/push cycle without waiting for the interval to expire:
# By PID: kill -USR1 <PID> # Or by matching process name: pkill -USR1 -f "sync_git_branch_continuously.py"
To check the status or inspect the output of the active background sync loop:
tail -n 20 "/tmp/sync_git_${REPO_NAME}_${BRANCH_NAME}.log"