# Pull main

> Pull main is an open-source agent skill for developer tools. Pull origin main into your branch and resolve any merge conflicts. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/richardgill/nix/tree/main/built/ai-agents/ampcode/skills/pull-main
- **Repository:** https://github.com/richardgill/nix
- **GitHub stars:** 39
- **License:** MIT
- **Skill name:** pull-main
- **Collection:** https://github.com/richardgill/nix
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-03

## About

This skill gives the agent a single instruction: run `git pull origin main --ff` to bring the latest main branch into the current working branch. The `--ff` flag allows a fast-forward when one is possible, so history stays linear when it can.

If the pull produces merge conflicts, the agent is told to handle them as part of the same task rather than stopping. The skill is a short, one-file instruction with no scripts, and it expects a git repository with an `origin` remote that has a `main` branch.

## When your agent uses it

> Pull main branch and handle merge conflicts

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/richardgill/nix/tree/HEAD/built/ai-agents/ampcode/skills/pull-main)
- [License: MIT](https://github.com/richardgill/nix/tree/HEAD/built/ai-agents/ampcode/skills/pull-main)

## Features

- **Pull from origin main:** Runs `git pull origin main --ff` to update the current branch with the remote main branch.
- **Fast-forward preferred:** Uses the fast-forward option so the pull avoids a merge commit when history allows.
- **Merge conflict handling:** Directs the agent to deal with any conflicts that appear after the pull.
- **Minimal single-file skill:** A short SKILL.md with no scripts or extra reference files.

## Good for

- Update a feature branch with the latest main before opening a pull request
- Sync a local branch with origin main and fix conflicts that come up
- Catch up on upstream changes after a long break from a branch
- Ask the agent to pull main and sort out the resulting merge conflicts

## Install

### Claude Code

Copy the skill folder to `~/.claude/skills/pull-main` to use it in all your projects:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/richardgill/nix.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/pull-main &&
cp -R "$tmp/built/ai-agents/ampcode/skills/pull-main" ~/.claude/skills/pull-main &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/pull-main` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/pull-main` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/richardgill/nix.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/pull-main &&
cp -R "$tmp/built/ai-agents/ampcode/skills/pull-main" ~/.agents/skills/pull-main &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/pull-main` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/pull-main` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/richardgill/nix.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/pull-main &&
cp -R "$tmp/built/ai-agents/ampcode/skills/pull-main" ~/.cursor/skills/pull-main &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/pull-main` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/richardgill/nix.git --path built/ai-agents/ampcode/skills/pull-main
```

Or copy the folder to `~/.gemini/skills/pull-main` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/pull-main`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/richardgill/nix.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/pull-main &&
cp -R "$tmp/built/ai-agents/ampcode/skills/pull-main" ~/.copilot/skills/pull-main &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/pull-main` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/richardgill/nix.git
```

Then copy `nix/built/ai-agents/ampcode/skills/pull-main` into your agent's skills folder as `pull-main`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What command does Pull main run?

It runs `git pull origin main --ff` and then handles any merge conflicts that result.

### Does Pull main include any scripts?

No. It is a single SKILL.md file with no scripts or extra files.

### What does Pull main need in the repository?

A git repository with an `origin` remote that has a `main` branch.

### What license is Pull main under?

The repository is licensed under MIT.

### How do I install Pull main in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/pull-main to use it in all your projects, or to .claude/skills/pull-main in one project.

### Does Pull main run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Pull main?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Pull main?

The closest alternatives to Pull main are Git merge, Rebase2main, Gha PR merge ref shows upstream changes, Fix merge conflicts and GitHub workflow.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Git merge](https://ai-powered.com/skills/git-merge): Git merge is an open-source agent skill for developer tools.
- [Rebase2main](https://ai-powered.com/skills/rebase2main): Rebase2main is an open-source agent skill for developer tools.
- [Gha PR merge ref shows upstream changes](https://ai-powered.com/skills/gha-pr-merge-ref-shows-upstream-changes): Gha PR merge ref shows upstream changes is an open-source agent skill for developer tools.
- [Fix merge conflicts](https://ai-powered.com/skills/fix-merge-conflicts): Fix merge conflicts is an open-source agent skill for developer tools.
- [GitHub workflow](https://ai-powered.com/skills/github-workflow): GitHub workflow is an open-source agent skill for developer tools.
- [Rebase current branch](https://ai-powered.com/skills/rebase-current-branch): Rebase current branch is an open-source agent skill for developer tools.
- [Gh PR merge worktree checkout trap](https://ai-powered.com/skills/gh-pr-merge-worktree-checkout-trap): Gh PR merge worktree checkout trap is an open-source agent skill for developer tools.
- [Commit push](https://ai-powered.com/skills/commit-push): Commit push is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/pull-main
