cortex git
Full git porcelain interface executed through the Cortex agent workspace. Ten subcommands provide complete git version control with agent-powered commit messages and branch management.
Usage
cortex git <subcommand> [options]
Subcommands
| Subcommand | Description |
|---|---|
status | Show working tree status |
log | Show commit history |
diff | Show changes between commits or working tree |
add | Stage files for commit |
commit | Create a new commit |
push | Push commits to remote |
pull | Pull changes from remote |
clone | Clone a repository |
branch | List or manage branches |
remote | Manage remote repositories |
Subcommand Details
cortex git status
cortex git status # Show working tree status
cortex git status --agent # Agent-powered status with suggestions
cortex git log
cortex git log # Show commit history
cortex git log --limit 20 # Limit to 20 entries
cortex git log --agent # Agent-powered log analysis
cortex git diff
cortex git diff # Show unstaged changes
cortex git diff --stat # Show diff statistics
cortex git diff --file path/to/file # Diff a specific file
cortex git diff --agent # Agent-powered diff summary
cortex git add
cortex git add path/to/file # Stage a specific file
cortex git add --all # Stage all changes
cortex git add --agent # Agent-powered staging suggestions
cortex git commit
cortex git commit # Create commit (agent generates message)
cortex git commit --all # Stage all and commit
cortex git commit --agent # Agent-powered commit with analysis
cortex git push
cortex git push # Push to default remote
cortex git push --remote origin # Specify remote
cortex git push --branch main # Specify branch
cortex git push --agent # Agent-powered push
cortex git pull
cortex git pull # Pull from default remote
cortex git pull --remote origin # Specify remote
cortex git pull --branch main # Specify branch
cortex git pull --agent # Agent-powered pull
cortex git clone
cortex git clone <url> # Clone a repository
cortex git clone <url> --branch main # Clone a specific branch
cortex git branch
cortex git branch # List all branches
cortex git branch --create feature-x # Create a new branch
cortex git branch --checkout main # Checkout a branch
cortex git branch --agent # Agent-powered branch management
cortex git remote
cortex git remote # List remotes
cortex git remote --add origin <url> # Add a remote
cortex git remote --url # Show remote URLs
cortex git remote --agent # Agent-powered remote management
Agent-Powered Features
When using the --agent flag, git commands leverage the Cortex agent to:
- Generate meaningful commit messages from diffs
- Suggest branch naming conventions
- Analyze change patterns for PR descriptions
- Detect potential merge conflicts
- Provide code review suggestions
Examples
# Agent-powered commit with auto-generated message
cortex git commit --agent
# Clone and set up a project
cortex git clone https://github.com/user/repo.git
# Create a feature branch
cortex git branch --create feature/new-dashboard
# Push to a specific remote branch
cortex git push --remote origin --branch feature/new-dashboard