Git Integration β
Claude Forge includes built-in Git integration, allowing you to manage version control without leaving the application.
Overview β
The Git panel in the sidebar shows:
- Current branch name
- Number of commits ahead/behind remote
- Changed files (staged and unstaged)
- Commit and push/pull controls
Git Status β
Branch Information β
At the top of the Git panel, you'll see:
- Branch icon - Indicates git status
- Branch name - Current checked-out branch
- Sync status - Shows
+Nfor ahead,-Nfor behind
Example:
π main +2 -1This means you're on main, 2 commits ahead, 1 behind.
Changed Files β
Files are grouped into two sections:
Staged Changes
- Files ready to be committed
- Shown with a checkmark
- Click to unstage
Unstaged Changes
- Modified files not yet staged
- Click to stage individually
- Use the
+button to stage all
File Status Indicators β
| Icon | Meaning |
|---|---|
| M | Modified |
| A | Added (new file) |
| D | Deleted |
| R | Renamed |
| ? | Untracked |
Staging Files β
Stage Individual Files β
- Find the file in "Changes" section
- Click the checkbox next to it
- The file moves to "Staged"
Stage All Files β
- In the "Changes" header, click the + button
- All unstaged files are staged at once
Unstage Files β
- Find the file in "Staged" section
- Click the checkbox to unstage
- The file returns to "Changes"
Committing β
Write a Commit Message β
- Click the commit message input at the bottom
- Type a descriptive message
- Follow conventional commit style:
feat: add user authentication fix: resolve login redirect bug docs: update API documentation
Create the Commit β
- Ensure you have staged changes
- Enter your commit message
- Click Commit or press Enter
- The commit is created locally
TIP
The Commit button is disabled if:
- No files are staged
- No commit message is entered
Push and Pull β
Pushing Changes β
- After committing, click Push
- Your commits are sent to the remote
- The "ahead" count resets to 0
Pulling Changes β
- Click Pull to fetch and merge remote changes
- Your local branch is updated
- The "behind" count resets to 0
Button States β
| Button | Enabled When |
|---|---|
| Push | You have commits ahead of remote |
| Pull | Always (checks for updates) |
Error Handling β
Common git operations may fail for various reasons:
Merge Conflicts β
If pull results in conflicts:
- The error is displayed in the Git panel
- Resolve conflicts manually in your editor
- Stage the resolved files
- Commit the merge resolution
Push Rejected β
If push is rejected:
- Usually means remote has new commits
- Pull first to merge remote changes
- Resolve any conflicts
- Push again
Authentication Errors β
If authentication fails:
- Check your git credentials are configured
- Ensure SSH keys are set up (if using SSH)
- Try authenticating via terminal first
Section Toggle β
Like other sidebar sections, Git can be collapsed:
- Click the chevron next to "Git" in the header
- The panel collapses to just the header
- Branch info remains visible
- Click again to expand
Not a Git Repository β
If you open a project that isn't a git repo:
- The Git panel shows "Not a git repository"
- No git operations are available
- Initialize git via terminal:
git init
Best Practices β
Commit Often β
Make small, focused commits:
- One logical change per commit
- Clear, descriptive messages
- Easier to review and revert
Review Before Commit β
Always check what's being staged:
- Look at the file list
- Understand each change
- Don't commit unintended changes
Pull Before Push β
Reduce conflicts by:
- Pulling latest changes
- Resolving any issues locally
- Then pushing your commits
Keyboard Shortcuts β
| Shortcut | Action |
|---|---|
Enter in commit input | Create commit |
Limitations β
- Basic operations only - No rebase, cherry-pick, etc.
- No diff view - Use external tools for detailed diffs
- No branch management - Switch branches via terminal
- No stash - Stash changes via terminal
For advanced git operations, use:
- Command line
- Your IDE's git features
- Dedicated git GUI tools
Troubleshooting β
Git panel not showing β
Possible causes:
- Not a git repository
- Git not installed
- Invalid git configuration
Solutions:
- Run
git statusin terminal to verify - Initialize with
git initif needed - Check git is in your PATH
Status not updating β
Solutions:
- Make a change to trigger refresh
- Switch projects and back
- Restart Claude Forge
Operations failing silently β
Solutions:
- Check the error message in the panel
- Try the operation in terminal for details
- Check git configuration