Git Integration
Version control your writing projects with Git.
Overview
Longhand has built-in Git support for tracking changes, branching, and collaborating on writing projects.
Setting Up Git
Initialize a Repository
- Open a project folder
- Press Ctrl+Shift+G to open the Git panel
- Click "Initialize Repository"
Clone a Repository
- Press Ctrl+Shift+G
- Click "Clone Repository"
- Enter the repository URL
- Choose a local folder
Basic Operations
Staging Changes
- Click the
+icon next to changed files to stage them - Or use "Stage All Changes" to stage everything
Committing
- Stage your changes
- Enter a commit message
- Press Ctrl+Enter or click "Commit"
Pushing and Pulling
- Push: Click the up arrow or press Ctrl+Shift+P
- Pull: Click the down arrow or press Ctrl+Shift+L
Branching
Create a Branch
- Click the branch name in the status bar
- Select "Create New Branch"
- Enter a branch name
Switch Branches
- Click the branch name in the status bar
- Select the branch to switch to
Merge Branches
- Switch to the target branch
- Open the Git panel
- Click "Merge Branch"
- Select the source branch
Viewing History
Press Ctrl+Shift+H to view commit history:
- See all commits with messages
- Click a commit to view changes
- Right-click to checkout or revert
Diff View
Longhand shows changes inline:
- Green highlighting for additions
- Red highlighting for deletions
- Side-by-side diff available in split view