# Pull Main

Switch to main branch and pull latest changes with prune.

- Repository: https://github.com/dyoshikawa/rulesync (1577 stars)
- Category: Engineering
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add dyoshikawa/rulesync --skill pull-main -g -a claude-code -y`
Codex: `npx skills add dyoshikawa/rulesync --skill pull-main -g -a codex -y`
Cursor: `npx skills add dyoshikawa/rulesync --skill pull-main -g -a cursor -y`
Gemini CLI: `npx skills add dyoshikawa/rulesync --skill pull-main -g -a gemini-cli -y`

## Description

Switch to main branch and pull latest changes with prune. Use when the user wants to pull latest main, update main, or sync main with remote.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Pull Main

Switch to the `main` branch and pull the latest changes from `origin/main` while pruning stale remote-tracking references.

## Step 1: Inspect Current State

Check the current branch:

```bash
git branch --show-current
```

If already on `main`, note it for the final report.

## Step 2: Switch to Main

Switch to the `main` branch:

```bash
git switch main
```

## Step 3: Pull with Prune

Pull the latest changes from `origin/main` with `--prune` to remove stale remote-tracking branches:

```bash
git pull --prune
```

## Step 4: Report Result

Summarize the operation:

- Whether a branch switch occurred
- Number of commits pulled (fast-forward or merge)
- Any stale remote-tracking branches that were pruned

