gg pull
Pull changes from remote repository with merge or rebase options.
Usage
bash
gg pull # Standard pull with merge
gg pull --rebase # Pull with rebase
gg pull --dry-run # Preview incoming changesOptions
| Option | Description |
|---|---|
-r, --rebase | Rebase local commits on top of upstream |
--dry-run | Show what would be pulled |
-y, --yes | Skip confirmation prompts |
Merge vs. Rebase
Pull with Merge (Default)
Creates a merge commit when there are divergent histories:
bash
gg pull
# Result: Merge commit created
# History: Preserves all branch historyPull with Rebase
Replays your local commits on top of the remote branch for linear history:
bash
gg pull --rebase
# Result: Local commits replayed on top
# History: Linear, cleaner logWhen to Use Rebase
Use
--rebase when working on feature branches to maintain a clean, linear history. Avoid rebasing shared branches that others are working on.Preview Mode
See what changes will be pulled without actually pulling:
bash
$ gg pull --dry-run
š„ Pull Preview
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Fetching from origin...
Incoming commits:
abc1234 fix: resolve null pointer exception
def5678 feat: add user preferences
ghi9012 docs: update API documentation
Files to be updated:
M src/services/user.ts
M src/components/Settings.tsx
A docs/api.md
Total: 3 commits, 3 files changedHandling Conflicts
When conflicts occur during pull, GitGuru provides AI assistance:
bash
$ gg pull
ā ļø Conflict detected in src/config.ts
Use GitGuru AI to help resolve:
gg ask "resolve conflicts in src/config.ts"
gg explain # See what conflicted and whyResolving Conflicts
bash
# Get AI help with conflicts
gg ask "help me resolve merge conflicts"
# After resolving, continue
gg commit -m "Merge remote changes"
# or
gg ask "commit merge resolution"Examples
Basic Pull
bash
# Pull latest changes from remote
gg pull
# Pull with automatic yes
gg pull -yRebase Workflow
bash
# Keep feature branch up to date with clean history
git checkout feature/my-feature
gg pull --rebase
# If conflicts occur, resolve and continue
gg ask "continue rebase after resolving conflicts"Before Pushing
bash
# Always pull before pushing to avoid conflicts
gg pull
gg push
# Or use sync to do both
gg syncWorking with Uncommitted Changes
If you have uncommitted changes, GitGuru will warn you:
bash
$ gg pull
ā ļø You have uncommitted changes
Options:
1. Stash changes: gg ask "stash my changes"
2. Commit changes: gg commit
3. Cancel pull
What would you like to do?bash
# Stash, pull, then restore
gg ask "stash my changes"
gg pull
gg ask "apply stash"Tracking Branches
Pull from a specific remote branch:
bash
# Pull from specific branch
gg ask "pull from origin/main into current branch"
# Set up tracking and pull
gg ask "set upstream to origin/main and pull"