Skip to content

mherrera53/GitMac

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

155 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

GitMac

GitMac Logo

A modern, native macOS Git client built with SwiftUI

macOS Swift License Build Status

Features โ€ข Installation โ€ข Architecture โ€ข Usage โ€ข Contributing


Overview

GitMac is a powerful, native macOS Git client designed to provide an exceptional developer experience. Built entirely with SwiftUI and leveraging native macOS technologies, GitMac offers blazing-fast performance, beautiful UI, and advanced Git features that streamline your development workflow.

Why GitMac?

  • ๐Ÿš€ Native Performance - Built with Swift and SwiftUI for optimal macOS performance
  • ๐ŸŽจ Modern UI - Clean, intuitive interface following Apple's Human Interface Guidelines
  • โšก๏ธ Fast - Instant repository switching, real-time diff viewing, and lightning-fast operations
  • ๐Ÿ”ง Advanced Features - Line-level staging, interactive rebase, AI-powered suggestions
  • ๐ŸŽฏ Developer-First - Keyboard shortcuts, customizable themes, and workflow automation
  • ๐Ÿ”’ Secure - Keychain integration, GPG signing support, and secure credential management

Features

Core Git Operations

  • โœ… Repository Management - Clone, initialize, and manage multiple repositories
  • โœ… Branch Operations - Create, merge, rebase, and delete branches with drag-and-drop support
  • โœ… Commit History - Beautiful commit graph with filtering and search
  • โœ… Staging - Stage entire files, hunks, or individual lines
  • โœ… Diff Viewing - Inline, split, and unified diff views with syntax highlighting
  • โœ… Stash Management - Save, apply, and manage stashes effortlessly

Advanced Features

  • ๐Ÿค– AI-Powered Features - Commit message generation, code review suggestions
  • ๐ŸŽฏ Smart Merge - Intelligent conflict resolution with visual merge tools
  • ๐Ÿ“Š Git Flow - Built-in Git Flow and custom workflow support
  • ๐Ÿ” Advanced Search - Search commits, files, and content across history
  • ๐Ÿท๏ธ Tag Management - Create, push, and manage tags with ease
  • ๐ŸŒ Remote Management - Configure and manage multiple remotes

Automation & Extensibility

  • โšก๏ธ Custom Workflows - Scriptable automation for Git operations
  • ๐Ÿงฉ Plugin System - Extend functionality with custom plugins
  • ๐Ÿ”ง Git Hooks UI - Visual management of Git hooks
  • ๐Ÿ‘ฅ Team Features - Shared settings, templates, and conventions
  • ๐ŸŒฒ Worktree Support - Multiple working trees management
  • ๐Ÿ“ฆ Submodules & LFS - Full support for submodules and large files

Integrations

  • GitHub - Issues, pull requests, and actions integration
  • GitLab - Merge requests and CI/CD pipeline viewing
  • Jira - Link commits to Jira issues
  • Linear - Issue tracking integration
  • Notion - Documentation and task management

Installation

Requirements

  • macOS 14.0 (Sonoma) or later
  • Xcode 15.0 or later (for building from source)
  • Git 2.30.0 or later

Quick Start

Option 1: Download Pre-built Binary

  1. Download the latest release from Releases
  2. Move GitMac.app to your /Applications folder
  3. Launch GitMac and grant necessary permissions

Option 2: Build from Source

# Clone the repository
git clone https://github.com/mherrera53/GitMac.git
cd GitMac

# Setup external frameworks
./scripts/setup-ghostty.sh

# Open in Xcode
open GitMac.xcodeproj

# Build and run (โŒ˜+R)

Option 3: Using Swift Package Manager

# Clone and build
git clone https://github.com/mherrera53/GitMac.git
cd GitMac
swift build -c release

# Run
.build/release/GitMac

First-Time Setup

  1. Configure Git - Set your name and email

    git config --global user.name "Your Name"
    git config --global user.email "[email protected]"
  2. Add SSH Key - For GitHub/GitLab access

    ssh-keygen -t ed25519 -C "[email protected]"
    cat ~/.ssh/id_ed25519.pub | pbcopy
  3. Launch GitMac - Open a repository or clone a new one


Architecture

System Architecture

graph TB
    A[GitMac App] --> B[UI Layer - SwiftUI]
    A --> C[Core Services]
    A --> D[Features]

    B --> B1[Components]
    B --> B2[Views]
    B --> B3[Themes]

    C --> C1[GitEngine]
    C --> C2[GitService]
    C --> C3[FileWatcher]

    D --> D1[Branches]
    D --> D2[Commits]
    D --> D3[Diff]
    D --> D4[Staging]
    D --> D5[Terminal]

    C1 --> E[Git CLI]
    C2 --> F[libgit2]
    D5 --> G[Ghostty Terminal]

    style A fill:#667AFF,color:#fff
    style B fill:#4CAF50,color:#fff
    style C fill:#FF9800,color:#fff
    style D fill:#2196F3,color:#fff
Loading

Data Flow

sequenceDiagram
    participant U as User
    participant UI as SwiftUI View
    participant VM as ViewModel
    participant GE as GitEngine
    participant Git as Git CLI

    U->>UI: Select Repository
    UI->>VM: Load Repository
    VM->>GE: Get Repository State
    GE->>Git: Execute git commands
    Git-->>GE: Return output
    GE-->>VM: Parse & Return Data
    VM-->>UI: Update State
    UI-->>U: Display Changes
Loading

Component Architecture

graph LR
    A[App Entry] --> B[ContentView]
    B --> C[MainLayout]
    C --> D[Left Sidebar]
    C --> E[Center Panel]
    C --> F[Right Panel]

    D --> D1[Repo List]
    D --> D2[Branches]
    D --> D3[Tags]

    E --> E1[Commit Graph]
    E --> E2[File Tree]
    E --> E3[Staging Area]

    F --> F1[Diff View]
    F --> F2[Commit Details]
    F --> F3[Terminal]

    style A fill:#667AFF,color:#fff
    style C fill:#4CAF50,color:#fff
Loading

File Structure

GitMac/
โ”œโ”€โ”€ ๐Ÿ“ App/
โ”‚   โ”œโ”€โ”€ GitMacApp.swift           # App entry point
โ”‚   โ”œโ”€โ”€ ContentView.swift         # Main app layout
โ”‚   โ””โ”€โ”€ AppState.swift            # Global app state
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ Core/
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ Git/
โ”‚   โ”‚   โ”œโ”€โ”€ GitEngine.swift       # Git operations actor
โ”‚   โ”‚   โ”œโ”€โ”€ GitService.swift      # High-level Git service
โ”‚   โ”‚   โ”œโ”€โ”€ PatchManipulator.swift # Line-level staging
โ”‚   โ”‚   โ””โ”€โ”€ DiffParser.swift      # Diff parsing utilities
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ Services/
โ”‚   โ”‚   โ”œโ”€โ”€ FileWatcher.swift     # File system monitoring
โ”‚   โ”‚   โ”œโ”€โ”€ KeychainService.swift # Credential management
โ”‚   โ”‚   โ””โ”€โ”€ NotificationManager.swift
โ”‚   โ”‚
โ”‚   โ””โ”€โ”€ ๐Ÿ“ Models/
โ”‚       โ”œโ”€โ”€ Repository.swift
โ”‚       โ”œโ”€โ”€ Branch.swift
โ”‚       โ”œโ”€โ”€ Commit.swift
โ”‚       โ””โ”€โ”€ FileStatus.swift
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ Features/
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ Branches/
โ”‚   โ”‚   โ”œโ”€โ”€ BranchListView.swift
โ”‚   โ”‚   โ””โ”€โ”€ BranchViewModel.swift
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ Commits/
โ”‚   โ”‚   โ”œโ”€โ”€ CommitGraphView.swift
โ”‚   โ”‚   โ””โ”€โ”€ CommitDetailView.swift
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ Diff/
โ”‚   โ”‚   โ”œโ”€โ”€ DiffView.swift
โ”‚   โ”‚   โ”œโ”€โ”€ InlineDiffView.swift
โ”‚   โ”‚   โ””โ”€โ”€ SplitDiffView.swift
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ Staging/
โ”‚   โ”‚   โ””โ”€โ”€ StagingAreaView.swift
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ Terminal/
โ”‚   โ”‚   โ”œโ”€โ”€ GhosttyDirect.swift
โ”‚   โ”‚   โ””โ”€โ”€ TerminalView.swift
โ”‚   โ”‚
โ”‚   โ””โ”€โ”€ ๐Ÿ“ Integrations/
โ”‚       โ”œโ”€โ”€ GitHub/
โ”‚       โ”œโ”€โ”€ GitLab/
โ”‚       โ”œโ”€โ”€ Jira/
โ”‚       โ””โ”€โ”€ Linear/
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ UI/
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ Components/
โ”‚   โ”‚   โ”œโ”€โ”€ AppTheme.swift        # App-wide theme
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“ Buttons/
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“ Icons/
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“ Rows/
โ”‚   โ”‚   โ””โ”€โ”€ ๐Ÿ“ Layout/
โ”‚   โ”‚
โ”‚   โ””โ”€โ”€ ๐Ÿ“ Utilities/
โ”‚       โ”œโ”€โ”€ Extensions.swift
โ”‚       โ””โ”€โ”€ Constants.swift
โ”‚
โ””โ”€โ”€ ๐Ÿ“ Resources/
    โ”œโ”€โ”€ Assets.xcassets
    โ””โ”€โ”€ Info.plist

Key Components Explained

GitEngine (Core/Git/GitEngine.swift)

The heart of GitMac's Git operations. Uses Swift actors for thread-safe, concurrent Git command execution.

actor GitEngine {
    func status(at path: String) async throws -> [FileStatus]
    func commit(message: String, at path: String) async throws
    func branches(at path: String) async throws -> [Branch]
}

AppTheme (UI/Components/AppTheme.swift)

Centralized theme management with support for light/dark modes and custom color schemes.

enum AppTheme {
    static let accent: Color
    static let background: Color
    static let textPrimary: Color
    // ... more theme colors
}

Usage

Basic Workflow

1. Open a Repository

// Via File Menu
File โ†’ Open Repository โ†’ Select folder

// Via Keyboard
โŒ˜ + O โ†’ Select repository

2. Make Changes and Stage

// Stage entire file
Click on file โ†’ Click "Stage" button

// Stage specific lines
Select lines in diff โ†’ Right-click โ†’ "Stage Selected Lines"

// Unstage
Click staged file โ†’ Click "Unstage" button

3. Commit Changes

// Write commit message
Type message in commit area

// Commit
โŒ˜ + Enter or Click "Commit" button

// Amend last commit
Hold โŒฅ (Option) + Click "Commit"

4. Push Changes

// Push to remote
Click "Push" button or โŒ˜ + P

// Force push (with lease)
Hold โŒ˜ + Shift + P

Advanced Features

Interactive Rebase

graph LR
    A[Select commits] --> B[Right-click]
    B --> C[Interactive Rebase]
    C --> D[Reorder/Squash/Edit]
    D --> E[Apply Changes]

    style C fill:#667AFF,color:#fff
Loading

Branch Management with Drag & Drop

graph TB
    A[Drag branch] --> B{Drop on?}
    B -->|Another branch| C[Merge]
    B -->|Commit| D[Rebase]
    B -->|Remote| E[Push]

    style A fill:#4CAF50,color:#fff
    style C fill:#FF9800,color:#fff
    style D fill:#FF9800,color:#fff
    style E fill:#2196F3,color:#fff
Loading

Keyboard Shortcuts

Action Shortcut
Open Repository โŒ˜ + O
New Repository โŒ˜ + N
Commit โŒ˜ + Enter
Push โŒ˜ + P
Pull โŒ˜ + Shift + P
Refresh โŒ˜ + R
Show Terminal โŒ˜ + T
Search Commits โŒ˜ + F
Switch Repository โŒ˜ + 1-9
Stage All โŒ˜ + A

Configuration

Settings

GitMac stores configuration in:

  • App Settings: ~/Library/Preferences/com.gitmac.app.plist
  • Repositories: ~/Library/Application Support/GitMac/repositories.json
  • Credentials: macOS Keychain

Custom Themes

Create custom themes by modifying AppTheme.swift:

enum AppTheme {
    // Your custom colors
    static let accent = Color(hex: "667AFF")
    static let background = Color(hex: "1E1E1E")
}

Terminal Customization

Configure the integrated terminal in Settings:

  • Font family and size
  • Color scheme
  • AI suggestions (enable/disable)
  • Shell preference

Development

Building

First-time setup (required for external frameworks):

# Setup external frameworks (creates stub framework for Ghostty)
./scripts/setup-ghostty.sh

Then build the project:

# Debug build
xcodebuild -scheme GitMac -configuration Debug

# Release build
xcodebuild -scheme GitMac -configuration Release

# Run tests
xcodebuild -scheme GitMac test

Note: The Ghostty terminal framework is optional. The setup script creates a minimal stub that allows compilation. For full Ghostty terminal functionality, see Frameworks/README.md.

Code Style

GitMac follows Swift best practices:

  • SwiftLint for code linting
  • Async/await for concurrency
  • Actors for thread safety
  • MVVM architecture pattern

Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Technology Stack

graph TB
    A[GitMac] --> B[SwiftUI]
    A --> C[Swift 5.9+]
    A --> D[Git CLI]
    A --> E[External Frameworks]

    B --> B1[Native macOS Components]
    B --> B2[AppKit Integration]

    E --> E1[KeychainAccess]
    E --> E2[Splash - Syntax Highlighting]
    E --> E3[Ghostty - Terminal]

    style A fill:#667AFF,color:#fff
    style B fill:#4CAF50,color:#fff
    style C fill:#FF9800,color:#fff
Loading

Dependencies

  • KeychainAccess - Secure credential storage
  • Splash - Syntax highlighting for diffs
  • Ghostty (Optional) - Advanced terminal emulation

Roadmap

โœ… Completed Features

All major features have been implemented! GitMac now includes:

  • Git LFS Support - Large file storage integration with visual management
  • Submodule Management - Complete visual submodule operations
  • Worktree Support - Multiple working trees with full UI
  • Custom Workflows - Scriptable automation with bash scripts
  • Team Features - Shared settings, templates, and team profiles
  • Plugin System - Fully extensible plugin architecture
  • Advanced Merge Conflict Resolution - Visual 3-way merge editor
  • Git Hooks Management UI - Complete hooks management interface
  • Performance Profiling - OSSignpost instrumentation throughout

๐Ÿš€ What's New

Custom Workflows

Create and automate your Git operations with custom scripts:

  • Pre/post commit hooks
  • Custom commands
  • Event-based triggers
  • Import/export workflows
  • 6 pre-built workflow templates

Team Features

Collaborate better with team profiles:

  • Shared settings and conventions
  • Commit message templates
  • Branch naming strategies
  • Git Flow, GitHub Flow, Trunk-Based
  • PR and issue templates

Plugin System

Extend GitMac with custom plugins:

  • Custom commands and panels
  • Event hooks (commits, pushes, etc.)
  • Built-in plugin examples
  • Import/export plugins
  • Scriptable plugin architecture

๐Ÿ”ฎ Future Enhancements

  • Cloud sync for workflows and settings
  • Advanced code review tools
  • Real-time collaboration features
  • More AI integrations
  • Enhanced performance analytics

Performance

GitMac is optimized for speed and efficiency:

Operation Time (avg) vs. Git CLI
Repository Load 50ms ~1x
Diff Calculation 100ms ~2x
Stage/Unstage 20ms ~1x
Commit 30ms ~1x
Branch Switch 80ms ~1.5x

Benchmarks performed on a MacBook Pro M1 with a 10,000 commit repository


Troubleshooting

Common Issues

Q: GitMac won't open repositories

# Check Git installation
git --version

# Verify repository
cd /path/to/repo && git status

Q: Slow performance

# Clean up repository
git gc --aggressive

# Reduce file watching scope in Settings

Q: Credentials not saving

# Reset keychain access
Preferences โ†’ Security โ†’ Reset Credentials

License

MIT License - see LICENSE for details


Acknowledgments

  • Apple - For SwiftUI and macOS frameworks
  • Git - For the amazing version control system
  • Open Source Community - For inspiration and contributions

Support the Project

If you find GitMac useful, consider supporting its development:

PayPal

Your support helps maintain and improve GitMac!


Contact & Support


Made with โค๏ธ for the macOS developer community

โญ๏ธ Star us on GitHub โ€ข ๐Ÿฆ Follow on Twitter โ€ข ๐Ÿ“– Read the Docs

About

A modern, native macOS Git client built with SwiftUI

Topics

Resources

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages