Skip to content

Seamlessly transfer work-in-progress between machines without committing to git history

License

Notifications You must be signed in to change notification settings

maquina-app/git-continuity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Git Continuity

Seamlessly transfer work-in-progress between machines without committing to git history

License: MIT Bash Platform

Git Continuity lets you export your staged and unstaged changes as a patch, transfer it to another machine, and continue working right where you left off—all without polluting your git history with "WIP" commits.

✨ Features

  • Beautiful Previews - See exactly what you're exporting/importing with Glow and Bat
  • Scrollable Previews - Navigate through long diffs with full keyboard control
  • Interactive TUI - Gorgeous terminal interface powered by Gum
  • Built-in SCP Transfer - Automatically transfer patches to remote hosts
  • Saved Hosts - Configure once, sync forever
  • Bidirectional - Work seamlessly between desktop ↔ laptop ↔ server
  • Smart Patching - Handles staged, unstaged, and binary files
  • Safe - Preview before export, preview before import—no surprises
  • Graceful Degradation - Works perfectly even without optional dependencies

Demo

# On your desktop
$ git add src/auth.rb spec/auth_spec.rb
$ git-continuity export

╭─────────────────────────────╮
│  👁  Changes to Export      │
╰─────────────────────────────╯

 src/auth.rb        | 45 ++++++++++++++++++++++++++++++------
 spec/auth_spec.rb  | 28 ++++++++++++++++++++++
 2 files changed, 67 insertions(+), 6 deletions(-)

[Beautiful syntax-highlighted diff with Glow]

Proceed with export? (y/N) ❯ y

✓ Patch created successfully
Transfer to remote host? (y/N) ❯ y

❯ laptop
  desktop
  
📤 Transferring to laptop...
✓ Successfully transferred!

# On your laptop
$ git-continuity import

╭───────────────────────────╮
│  📥 Import Git Changes    │
╰───────────────────────────╯

❯ feature-auth-20250117.patch

📋 Patch Information
Created: 2025-01-17 14:30:22
Branch: feature/auth

Apply this patch? (y/N) ❯ y

✓ Patch applied successfully!

Quick Start

Installation

macOS (with Homebrew)

# Install optional dependencies (recommended for best experience)
brew install gum glow bat

# Download and install git-continuity
curl -O https://raw.githubusercontent.com/yourusername/git-continuity/main/git-continuity.sh
chmod +x git-continuity.sh
sudo mv git-continuity.sh /usr/local/bin/git-continuity

Linux

# Install Gum
go install github.com/charmbracelet/gum@latest

# Install Glow
go install github.com/charmbracelet/glow@latest

# Install Bat
# Ubuntu/Debian
sudo apt install bat

# Arch Linux
sudo pacman -S bat

# Fedora
sudo dnf install bat

# Download and install git-continuity
curl -O https://raw.githubusercontent.com/yourusername/git-continuity/main/git-continuity.sh
chmod +x git-continuity.sh
sudo mv git-continuity.sh /usr/local/bin/git-continuity

Manual Installation

# Clone the repository
git clone https://github.com/yourusername/git-continuity.git
cd git-continuity

# Make executable
chmod +x git-continuity.sh

# Optional: Add to PATH
sudo cp git-continuity.sh /usr/local/bin/git-continuity

First Sync

# 1. Configure a remote host (one-time setup)
git-continuity config
# Add your laptop: user@laptop-ip:~/patches

# 2. Export your work
cd your-project
git add .
git-continuity export

# 3. On your other machine, import
git-continuity import
# Select the patch and apply!

Usage

Export (Create Patch)

# Interactive mode with preview
git-continuity export

# Specify filename
git-continuity export my-feature.patch

# Export and transfer via SCP
git-continuity export --scp laptop

# Skip preview for speed
git-continuity export --no-preview

Import (Apply Patch)

# Interactive mode with preview
git-continuity import

# Direct file
git-continuity import my-feature.patch

# Skip preview for speed  
git-continuity import --no-preview

Preview Patch

# Preview without applying
git-continuity preview my-feature.patch

# Interactive preview
git-continuity
# Choose "Preview patch"

Configuration

# Manage remote hosts
git-continuity config

# List available patches
git-continuity list

Use Cases

Daily Development Workflow

# Morning: Start on desktop
git add src/feature.rb
git-continuity export --scp laptop

# Afternoon: Continue on laptop at coffee shop
git-continuity import
# ... work continues ...
git-continuity export --scp desktop

# Evening: Back to desktop, finalize
git-continuity import
git commit -m "Complete feature"
git push

Code Review

# Teammate sends you a patch
git-continuity preview team-feature.patch
# Review the changes
git-continuity import team-feature.patch

Testing on Another Machine

# Export experimental changes
git-continuity export experiment.patch

# Test on another machine without committing
# If it works: commit on original machine
# If it fails: discard and keep working

Offline Work

# Export to USB drive
git-continuity export work.patch
cp work.patch /Volumes/USB/

# Import on air-gapped machine
git-continuity import /Volumes/USB/work.patch

Configuration

Remote Hosts

Configured hosts are saved in: ~/.config/git-continuity/config

# Interactive configuration
git-continuity config

# Example config file
HOST_laptop_HOST="user@192.168.1.10"
HOST_laptop_PATH="~/git-continuity-patches"
HOST_desktop_HOST="mydesktop.local"
HOST_desktop_PATH="~/patches"

SSH Config Integration

Git Continuity works seamlessly with your ~/.ssh/config:

# ~/.ssh/config
Host laptop
    HostName 192.168.1.10
    User myuser
    IdentityFile ~/.ssh/id_rsa
    
Host desktop
    HostName 192.168.1.20
    User myuser

Then just use: git-continuity export --scp laptop

Patch Storage

Patches are stored in: ~/.local/share/git-continuity/patches/

This centralized location makes the import picker work automatically and keeps your patches organized.

Preview Features

Export Preview

Before creating a patch, see:

  • File statistics (additions/deletions)
  • Complete diff with syntax highlighting
  • Confirmation before proceeding

Import Preview

Before applying a patch, see:

  • Patch metadata (date, branch, commit)
  • Change summary
  • Optional full diff review
  • Untracked files list

Scrollable Previews for Long Diffs

Git Continuity automatically detects when previews are too long for your terminal and enables scrollable pager mode with full navigation support.

When viewing a long diff, you'll see:

Long diff detected - entering scrollable view (press 'q' to exit)

⌨Navigation Keys

Basic Navigation:

Space / f     : Scroll down one page
b             : Scroll up one page
↓ / ↑         : Scroll line by line
d / u         : Scroll half-page down/up
g / G         : Jump to beginning/end

Search & Find:

/pattern      : Search forward for pattern
?pattern      : Search backward for pattern
n             : Jump to next search result
N             : Jump to previous search result

Exit:

q             : Quit preview and continue

Search Examples

While viewing a preview, you can search for:

bash

/api_key      # Find API keys or secrets
/TODO         # Find TODO comments
/password     # Check for hardcoded passwords
/^diff --git  # Jump between different files
/FIXME        # Find FIXME comments

Example workflow:

bash

$ git-continuity export

# Preview appears with 500 lines of changes
📜 Long diff detected - entering scrollable view (press 'q' to exit)

# Press '/' to search
/api_key

# Found on line 127
# Press 'n' to find next occurrence
# Press 'q' when done reviewing

Preview Tools

  • Glow (preferred): Beautiful markdown-style formatted diffs
  • Bat (fallback): Syntax-highlighted with line numbers
  • Plain (always works): Basic colored output

Requirements

Required

  • Bash 5.0+
  • Git

Optional (for enhanced features)

  • Gum - Interactive TUI
  • Glow - Beautiful diff rendering
  • Bat - Syntax highlighting
  • SSH/SCP - For automatic transfers

Note: Git Continuity works perfectly without optional dependencies—it gracefully falls back to basic functionality.

Why Git Continuity?

The Problem

You're working on a feature but need to switch machines:

  • ❌ Committing WIP work pollutes git history
  • ❌ Pushing incomplete code to remote is unprofessional
  • ❌ Stashing doesn't transfer between machines
  • ❌ Manual git diff > patch is tedious and error-prone

The Solution

Git Continuity creates portable patches of your work:

  • ✅ No WIP commits in your history
  • ✅ Transfer via SCP, USB, cloud—your choice
  • ✅ Handles staged, unstaged, and binary files
  • ✅ Preview before export/import—catch mistakes
  • ✅ Simple, fast, and reliable

Troubleshooting

Gum/Glow/Bat not found

The script works without them—install for better UX:

brew install gum glow bat

SCP permission denied

Set up SSH keys:

ssh-copy-id user@hostname

Patch not applying

  • Ensure you're in the correct git repository
  • Check that base commits are similar
  • Review conflicts with: git status

Can't find patch on import

  • Check: git-continuity list
  • Use full path: git-continuity import /full/path/to/patch.patch

License

MIT License - see LICENSE file for details

Acknowledgments

Built with amazing tools from the Charm community:

  • Gum - Interactive TUI components
  • Glow - Markdown rendering
  • Bat - Syntax highlighting

Made with ❤️ for developers who work across multiple machines

About

Seamlessly transfer work-in-progress between machines without committing to git history

Topics

Resources

License

Stars

Watchers

Forks

Languages