> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vibehub.co.in/llms.txt
> Use this file to discover all available pages before exploring further.

# vibe pull

> Pull commits from VibeHub to your local machine

## Usage

```bash theme={null}
vibe pull [remote] [branch] [options]
```

## Description

Pull commits and files from your VibeHub project to your local machine. This syncs your local repository with the remote state.

## Arguments

<ParamField query="remote" type="string">
  Remote name to pull from. Defaults to `origin`.
</ParamField>

<ParamField query="branch" type="string">
  Branch to pull. Defaults to the current branch.
</ParamField>

## Options

<ParamField query="-f, --force" type="boolean">
  Force pull and overwrite local changes. Use with caution.
</ParamField>

<ParamField query="-d, --dry-run" type="boolean">
  Preview what would be pulled without actually pulling.
</ParamField>

<ParamField query="-p, --project-id" type="string">
  Specify a project ID to pull from.
</ParamField>

## Examples

### Basic Pull

```bash theme={null}
vibe pull
```

Pulls all new commits from the current branch on the connected VibeHub project.

### Pull from a Specific Branch

```bash theme={null}
vibe pull origin develop
```

Pulls commits from the `develop` branch on the remote.

### Preview Changes

```bash theme={null}
vibe pull --dry-run
```

Shows what would be pulled without making any changes.

### Force Pull

<Warning>
  Force pulling will overwrite your local changes. Make sure to backup any unsaved work.
</Warning>

```bash theme={null}
vibe pull --force
```

## Branch Workflow

VibeHub CLI uses Git for local branch management. Here's how to work with branches:

### Pull from Current Branch

```bash theme={null}
# Ensure you're on the right branch
git checkout main

# Pull latest changes
vibe pull
```

### Pull from a Different Branch

```bash theme={null}
# Pull from develop branch regardless of current local branch
vibe pull origin develop
```

### Switch Branch and Pull

```bash theme={null}
# Switch to feature branch
git checkout feature/user-auth

# Pull latest changes for that branch
vibe pull
```

## What Gets Pulled

When you pull, you receive:

| Content         | Included                  |
| --------------- | ------------------------- |
| New commits     | Yes                       |
| Updated files   | Yes                       |
| Deleted files   | Yes                       |
| Commit metadata | Yes                       |
| AI prompts      | Yes (viewable in VibeHub) |

## Prerequisites

Before pulling, ensure you have:

1. **Authenticated** with `vibe login`
2. **Initialized** your project with `vibe init`
3. **Connected** to a VibeHub project with `vibe set <project-url>`

## Output

A successful pull shows:

```
📥 Pulling from origin/main...
📥 Pulling all data from VibeHub cloud...
✅ Successfully pulled from VibeHub cloud!
  Total commits: 5
  Total sessions: 2
  Total prompts: 12
💾 Saving cloud data locally...
✅ Successfully added 19 items from cloud to local repository
```

## Handling Conflicts

If your local changes conflict with remote changes:

```
Warning: Local changes would be overwritten.
Files with conflicts:
  - src/app.js
  - config/settings.json

Use --force to overwrite local changes, or commit/stash them first.
```

### Resolving Conflicts

1. **Backup your changes**: Copy modified files elsewhere
2. **Force pull**: `vibe pull --force`
3. **Manually merge**: Re-apply your changes to the pulled files

## Use Cases

<AccordionGroup>
  <Accordion title="Syncing Multiple Machines" icon="laptop">
    Use pull to get the latest code when switching between computers.

    ```bash theme={null}
    # On your second machine
    vibe pull
    ```
  </Accordion>

  <Accordion title="Getting Team Changes" icon="users">
    Pull to receive commits pushed by collaborators.

    ```bash theme={null}
    vibe pull
    # Review what changed
    vibe status
    ```
  </Accordion>

  <Accordion title="Pull from Feature Branch" icon="code-branch">
    Pull changes from a specific feature branch.

    ```bash theme={null}
    vibe pull origin feature/new-api
    ```
  </Accordion>

  <Accordion title="Starting Fresh" icon="rotate">
    Force pull to reset your local state to match VibeHub.

    ```bash theme={null}
    vibe pull --force
    ```
  </Accordion>
</AccordionGroup>

## Error Handling

### Not Connected

```
Error: No project connected. Run 'vibe set <project-url>' first.
```

**Solution:** Connect to a project with `vibe set`.

### Not Authenticated

```
Error: Not logged in. Run 'vibe login' first.
```

**Solution:** Authenticate with `vibe login`.

### Access Denied

```
❌ Access denied
You don't have permission to pull from this project.
```

**Solution:** Request access from the project owner.

### No Remote Changes

```
📭 No data found in VibeHub cloud
```

This means the cloud project is empty or you're already up to date.

## Related Commands

* [vibe push](/cli/commands/push) - Push commits to VibeHub
* [vibe status](/cli/commands/status) - Check sync status
* [vibe clone](/cli/commands/clone) - Clone a project
