Git Panel
The Git Panel is your central hub for Git operations in Glass.Panel Overview
- File status - View modified, staged, and untracked files
- Diff viewing - See changes inline or in dedicated views
- Staging - Stage and unstage changes
- Commit history - Browse commit log
- Branch management - Switch, create, and delete branches
The Git Panel automatically updates when you make changes to your files, keeping your version control state always visible.
File Status and Staging
Glass displays file status using Git’s status tracking.Status Display
- Modified - Changes not yet staged
- Staged - Changes ready to commit
- Untracked - New files not in Git
- Deleted - Removed files
- Renamed - Moved or renamed files
- Conflicted - Merge conflicts
Staging Changes
Stage changes directly from the editor:- Click to stage individual files
- Stage hunks of changes within a file
- Stage individual lines for precise commits
- Unstage previously staged changes
Viewing Diffs
Glass provides multiple ways to view code changes.Inline Diff View
- Side-by-side - Compare old and new versions
- Unified diff - Traditional diff format
- Inline changes - Highlighted within the editor
Text Diff View
- Syntax highlighting in both versions
- Word-level diffs for precise change identification
- Navigate between hunks quickly
- Fold unchanged regions for focus
Multi Diff View
- Batch review of related changes
- Selectively stage from multiple files
- Compare across commits
- Working Changes
- Staged Changes
- Commit Diff
View unstaged changes in your working directory:
Git Blame
See who last modified each line of code and when.Blame UI
- Author of each change
- Commit hash for the change
- Timestamp when changed
- Commit message describing why
Blame Entry Details
- View full commit details
- Open commit in history
- See all files in that commit
- Navigate to diff view
Git blame updates in real-time as you navigate through files, providing immediate context about code authorship.
Committing Changes
Create commits with an integrated commit modal.Commit Modal
Write Commit Message
Open the commit modal to write your message. Glass uses a template from
commit_message_prompt.txt to guide you.Commit View
- Chronological log of commits
- Branch visualization showing relationships
- Commit details with full diffs
- Search commits by message, author, or hash
Branch Management
Work with Git branches efficiently.Branch Picker
- Switch branches quickly with fuzzy search
- Create new branches from current or specific commits
- View branch list with last commit info
- Track remote branches and their status
Branch Information
- Current branch name
- Upstream tracking status
- Ahead/behind commit counts
- Divergence warnings
Remote Operations
Interact with remote repositories.Push and Pull
- Push
- Pull
- Fetch
Push your commits to the remote repository:
- Push - Standard push to tracked branch
- Push To - Select target remote and branch
- Force Push - Overwrite remote history (use carefully!)
Remote Output
- Progress indicators for long operations
- Error messages with helpful context
- Authentication prompts when needed
- Transfer statistics for push/pull
Stash Management
Temporarily save and restore changes.Stash Operations
Worktrees
Manage Git worktrees for working on multiple branches simultaneously.Worktree Picker
- Create worktrees for different branches
- Switch between worktrees in the same project
- Configure worktree directory location
- Remove worktrees when done
Worktree Configuration
- Default location is
../worktreesrelative to your project - Customize via
git.worktree_directorysetting - Automatic repository name appending for uniqueness
Worktrees share the same repository but allow different branches to be checked out simultaneously, perfect for reviewing PRs or working on features in parallel.
Merge Conflicts
Resolve merge conflicts with dedicated UI.Conflict View
- 3-way merge view - See base, local, and remote versions
- Inline conflict markers with syntax highlighting
- Accept incoming/current with one click
- Manual editing for complex conflicts
Unmerged Status
- Both modified - Same file changed on both sides
- Both added - New file added on both sides
- Deleted by us/them - Removal conflicts
Repository Management
Work with Git repositories at the project level.Repository Selector
- Switch between repositories in the workspace
- View per-repository status
- Separate operations by repository
Repository Interface
- Authentication handling via askpass
- Hook execution support
- Large file handling (Git LFS)
- Submodule support
Git Graph
Visualize commit history as a graph.Graph Visualization
- Branch visualization showing merges and divergence
- Chronological ordering of commits
- Parent relationships clearly displayed
- Lazy loading for performance with large histories
File History
View the complete history of individual files.File History View
- All commits affecting the file
- Diffs for each commit showing what changed
- Blame information at each version
- Follow renames across file moves
Pull Request Integration
Create pull requests directly from Glass.- Push your branch to the remote
- Create PR from Git panel
- Fill in details in your browser
- Track PR status in Glass
Clone Repositories
- GitHub - Direct integration
- GitLab - Full support
- Generic Git URLs - Any Git remote
- Local paths - Clone local repositories
Best Practices
- Review diffs before committing to ensure only intended changes are included
- Write meaningful commit messages following your team’s conventions
- Use partial staging to create focused, atomic commits
- Leverage git blame to understand code history and context
- Create branches for new features or experiments
- Fetch regularly to stay up-to-date with remote changes
- Resolve conflicts carefully using the 3-way merge view
- Use stashes to preserve work when switching contexts
Related Features
- Code Editing - Edit files with Git integration
- Navigation - Navigate through commit history
- Testing - Run tests before committing