Skip to content

Fork Sync

Learn how to keep your fork synchronized with the upstream repository to receive the latest updates, bug fixes, and features.

The original repository receives updates from other contributors. You need to sync your fork to:

  • ✅ Get the latest features and bug fixes
  • ✅ Stay compatible with upstream changes
  • ✅ Reduce merge conflicts when contributing
  • ✅ Keep your fork’s tags up-to-date

The easiest way to keep your fork up-to-date is using the automated GitHub Actions workflow.

You can manually trigger the sync workflow:

  1. Go to your fork on GitHub
  2. Click Actions tab
  3. Select Sync Upstream workflow
  4. Click Run workflow
  5. Click Run workflow button

GitHub provides a built-in “Sync fork” button for quick updates.

  1. Go to your fork on GitHub
  2. Click “Sync fork” (appears when your fork is behind)
  3. Click “Update branch”

For more control, you can sync your fork manually using Git commands.

The project includes convenient Task commands:

Terminal window
# Update fork with latest changes from upstream
task fork:update
# Sync tags from upstream
task fork:sync-tags
# Complete fork sync (code + tags)
task fork:sync
Terminal window
# Switch to main branch
git checkout main
# Fetch updates from upstream
git fetch upstream
# Merge upstream changes
git merge upstream/main
# Push to your fork
git push origin main
# Sync tags
git fetch upstream --tags
git push origin --tags
Terminal window
# Fetch from upstream
git fetch upstream
# Merge specific branch
git merge upstream/dev-main
# Push to your fork
git push origin dev-main

When working on a feature branch, you may need to sync it with the latest upstream changes.

Terminal window
# Switch to your feature branch
git checkout feature/my-feature
# Fetch latest from upstream
git fetch upstream
# Merge upstream/main into your feature branch
git merge upstream/main
# Resolve any conflicts if needed
# ... edit files ...
git add .
git commit -m "Merge upstream changes"
# Push updated branch
git push origin feature/my-feature
Terminal window
# Switch to your feature branch
git checkout feature/my-feature
# Fetch latest from upstream
git fetch upstream
# Rebase your branch on top of upstream/main
git rebase upstream/main
# Resolve any conflicts if needed
# ... edit files ...
git add .
git rebase --continue
# Force push (rebase rewrites history)
git push origin feature/my-feature --force

If you get merge conflicts when syncing:

Terminal window
# 1. Identify conflicting files
git status
# 2. Edit conflicting files and resolve conflicts
# Look for conflict markers: <<<<<<<, =======, >>>>>>>
# 3. Stage resolved files
git add path/to/resolved/file.php
# 4. Complete the merge
git commit -m "Resolve merge conflicts with upstream"
# 5. Push to your fork
git push origin main

If your fork has diverged significantly:

Terminal window
# Option 1: Reset to upstream (⚠️ loses your changes)
git fetch upstream
git reset --hard upstream/main
git push origin main --force
# Option 2: Create a backup first
git branch backup-main
git reset --hard upstream/main
git push origin main --force

If the automatic sync workflow fails:

  1. Check the workflow run in Actions tab
  2. Look for error messages
  3. Common issues:
    • Merge conflicts (requires manual resolution)
    • Missing DATA_HELPERS_PAT secret
    • PAT expired or lacks required scopes
  • ✅ Sync your fork regularly (at least weekly)
  • ✅ Sync before starting new features
  • ✅ Sync before creating pull requests
  • ✅ Use automatic sync for hands-off maintenance
  • ✅ Keep tags synced with upstream
  • ✅ Don’t delete upstream tags
  • ✅ Use custom tag prefixes for your tags (e.g., custom-v1.0.0)
  • ✅ Document custom tags in your fork’s README
  • ✅ Keep main branch clean (only upstream changes)
  • ✅ Create feature branches for your changes
  • ✅ Regularly sync feature branches with upstream
  • ✅ Delete merged feature branches

Sync Methods:

  1. Automatic (Recommended) - GitHub Actions every hour
  2. GitHub Button - Quick one-click sync
  3. Taskfile - task fork:sync
  4. Manual Git - Full control with Git commands

What Gets Synced:

  • ✅ Code changes from upstream/main
  • ✅ New tags from upstream
  • ✅ Branch updates
  • 🔒 Your custom changes remain safe