← Back to list

worktree-sync
by mvillmow
Training framework written in Mojo
⭐ 11🍴 4📅 Jan 24, 2026
SKILL.md
name: worktree-sync description: "Sync git worktrees with remote and main branch changes. Use to keep long-running feature branches up-to-date." mcp_fallback: none category: worktree
Worktree Sync
Keep worktrees synchronized with remote changes.
When to Use
- Long-running feature branches
- Main branch has new commits
- Before creating/updating PR
- Resolving merge conflicts
- Feature branch is diverged from main
Quick Reference
# Fetch latest from remote (works in any worktree)
git fetch origin
# Update main worktree
cd ../ProjectOdyssey && git pull origin main
# Update feature worktree (rebase approach)
cd ../ProjectOdyssey-42-feature && git rebase origin/main
# Update feature worktree (merge approach)
cd ../ProjectOdyssey-42-feature && git merge origin/main
# Auto-sync all worktrees
./scripts/sync_all_worktrees.sh
Workflow
- Fetch remote -
git fetch origin(any worktree) - Update main - Navigate to main worktree,
git pull origin main - Update feature - Navigate to feature worktree,
git rebase origin/mainorgit merge - Resolve conflicts - If conflicts occur, fix files and
git rebase --continue - Verify - Check
git logto confirm main branch changes are included
Rebase vs Merge
| Approach | Use When | Command |
|---|---|---|
| Rebase | Linear history preferred | git rebase origin/main |
| Merge | Preserving branch history | git merge origin/main |
Error Handling
| Error | Solution |
|---|---|
| Conflicts during rebase | Run git status, fix files, git add ., git rebase --continue |
| Diverged branches | Use git pull --rebase origin main |
| Uncommitted changes | Commit or stash before syncing |
| Detached HEAD | Check git status and git checkout <branch> |
Conflict Resolution
# If conflicts occur
git status # See conflicted files
# Edit files to resolve conflicts
# Then continue
git add .
git rebase --continue
# Or abort if something went wrong
git rebase --abort
Best Practices
- Fetch regularly to catch conflicts early
- Sync before creating PR to avoid merge conflicts
- Keep feature branches short-lived (2-3 days max)
- Resolve conflicts immediately
- Use rebase for linear history (preferred for this project)
References
- See
worktree-createskill for creating worktrees - worktree-strategy.md
Score
Total Score
60/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
Reviews
💬
Reviews coming soon