Git Repo
Git repository management and SourceGit GUI client integration.
Topics
| Topic | Description | Guide |
|---|---|---|
| clone | ghq get with automatic SourceGit registration (multi-account support) | clone.md |
| fix-worktree | bare repo worktree configuration recovery | fix-worktree.md |
| merge-duplicate | merge duplicate repositories with the same origin | merge-duplicate.md |
| migrate | migrate regular Git repositories to ghq directory structure | migrate.md |
| patrol | batch inspection of ghq repositories (status, stash, unpushed + commit-splitter integration) | patrol.md |
| sourcegit | SourceGit preference.json management (add repos, workspaces, folder rename) | sourcegit.md |
Quick Reference
ghq Clone (automatic SourceGit registration)
When ghq get <url> is executed, the following happens automatically:
- Clone the repository
- Register in SourceGit (under the appropriate group)
- Auto-create the group if it doesn't exist
Proceeds automatically without user confirmation
SourceGit Management
Directly edit the SourceGit GUI client's configuration file to add repositories, create workspaces, rename folders, etc.
Key features:
- Add/remove repositories
- Create workspaces
- Sync ghq repositories
- Update paths on folder rename
ghq Migration
Migrate regular Git repositories to ghq directory structure (~/ghq/host/group/repo/).
Key features:
- Automatic bare+worktree structure conversion
- Create symbolic links at original location
- Nested group support (host/group/subgroup/repo)
Repo Patrol (batch inspection)
Batch inspect and clean up the status of repositories under ghq.
Key features:
- Parallel collection of status, stash, unpushed for all repositories
- Status-based processing (commit-splitter integration, stash pop, push)
- Optional fetch all at the end
Common Workflow
- Repository migration: Migrate to ghq structure with
migratetopic - SourceGit update: Register new paths with
sourcegittopic - Batch inspection: Clean up uncommitted/unpushed changes with
patroltopic
Scripts
./scripts/repo-to-ghq.sh- Script to move repositories to ghq path