From 14ea44a9dd188c10009da447f0643d0ec1a5d8f4 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 28 May 2026 22:21:24 +0900 Subject: [PATCH] feat: add pull-main command to switch to main and pull --prune --- .rulesync/commands/pull-main.md | 45 +++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .rulesync/commands/pull-main.md diff --git a/.rulesync/commands/pull-main.md b/.rulesync/commands/pull-main.md new file mode 100644 index 000000000..7b485d761 --- /dev/null +++ b/.rulesync/commands/pull-main.md @@ -0,0 +1,45 @@ +--- +targets: + - "*" +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. +--- + +# 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