A tool to clone, organize, and manage multiple Git repositories with an automatic directory structure based on repository URLs.
- Overview
- Features
- Prerequisites
- Installation
- Quick Start
- Usage
- Configuration
- Examples
- Testing
- Troubleshooting
- Contributing
- License
- Acknowledgments
git-get solves the problem of manually organizing multiple Git repositories. Instead of scattered clones in random directories, it creates a clean, predictable directory structure based on repository URLs, similar to Go's go get command.
It provides two commands through a single binary:
git get- Clones repositories into an organized directory treegit list- Shows the status of all your repositories at a glance
Note: Both commands are provided by a single git-get binary that automatically detects how it was invoked (either directly or via symlink).
- Automatic organization - Creates directory structure based on repository URL
- Git integration - Seamlessly integrates as native Git commands
- Multi-platform - Works on macOS, Linux, and Windows
- Repository discovery - Lists all repositories with their status
- Flexible configuration - Supports environment variables and Git config
- Multiple output formats - Tree, flat, and dump formats for different use cases
- Dotfiles friendly - Clone multiple repositories from a list kept in dotfiles
- Git 2.0+ installed and configured
- Go 1.24+ (only if building from source)
Option 1: Homebrew (Recommended)
brew install grdl/tap/git-getThis automatically installs both git-get and git-list commands.
Option 2: Manual Installation
- Download the latest macOS
.tar.gzfile from releases - Extract and install:
tar -xzf git-get_*_darwin_*.tar.gz sudo mv git-get /usr/local/bin/ sudo ln -sf /usr/local/bin/git-get /usr/local/bin/git-list
Option 1: Package Managers (Recommended)
# Ubuntu/Debian - Download and install .deb package
wget https://github.com/grdl/git-get/releases/latest/download/git-get_*_linux_amd64.deb
sudo dpkg -i git-get_*_linux_amd64.deb
# CentOS/RHEL/Fedora - Download and install .rpm package
wget https://github.com/grdl/git-get/releases/latest/download/git-get_*_linux_amd64.rpm
sudo rpm -i git-get_*_linux_amd64.rpmPackage installation automatically creates the git-list symlink.
Option 2: Manual Installation
# Download and extract
wget https://github.com/grdl/git-get/releases/latest/download/git-get_*_linux_amd64.tar.gz
tar -xzf git-get_*_linux_amd64.tar.gz
# Install binary and create symlink
sudo mv git-get /usr/local/bin/
sudo ln -sf /usr/local/bin/git-get /usr/local/bin/git-listOption 3: Homebrew on Linux
brew install grdl/tap/git-getOption 1: Scoop (Recommended)
scoop bucket add grdl https://github.com/grdl/homebrew-tap
scoop install git-getThis automatically creates both git-get.exe and git-list.exe commands.
Option 2: Manual Installation
- Download the latest Windows
.zipfile from releases - Extract
git-get.exeto a directory in your PATH - Create a copy or hard link for
git-list:# In the same directory as git-get.exe Copy-Item git-get.exe git-list.exe # OR create a hard link (requires admin privileges) New-Item -ItemType HardLink -Path "git-list.exe" -Target "git-get.exe"
git clone https://github.com/grdl/git-get.git
cd git-get
go build -o git-get ./cmd/
# Create symlink for git-list
ln -sf git-get git-list # Unix/Linux/macOS
# OR
copy git-get.exe git-list.exe # WindowsNote: The single binary (git-get) automatically detects how it's invoked and behaves as either git-get or git-list accordingly.
- Install git-get using one of the methods above
- Clone your first repository:
git get github.com/grdl/git-get
- List your repositories:
git list
That's it! Your repository is now organized in ~/repositories/github.com/grdl/git-get/.
Clone repositories with automatic directory structure:
git get <REPOSITORY> [flags]Flags:
-b, --branch <name>- Branch or tag to checkout after cloning-d, --dump <file>- Clone multiple repositories from a dump file-t, --host <host>- Default host for short repository names (default: github.com)-r, --root <path>- Root directory for repositories (default: ~/repositories)-c, --scheme <scheme>- Default scheme for URLs (default: ssh)-s, --skip-host- Skip creating host directory-h, --help- Show help-v, --version- Show version
Repository formats:
- Full URL:
https://github.com/user/repo.git - SSH URL:
[email protected]:user/repo.git - Short format:
user/repo(uses default host) - GitHub format:
github.com/user/repo
Display repository status with multiple output formats:
git list [flags]Flags:
-f, --fetch- Fetch from remotes before listing-o, --out <format>- Output format: tree, flat, or dump (default: tree)-r, --root <path>- Root directory to scan (default: ~/repositories)-h, --help- Show help-v, --version- Show version
Output formats:
Generate dump file from existing repositories:
git list --out dump > my-repos.txtClone all repositories from the dump file:
git get --dump repos.txtAll configuration options that can be set via command-line flags, can also be set by environment variables, or Git configuration files.
Priority order (highest to lowest):
- Command-line flags
- Environment variables
- Git configuration file
- Default values
Use the GITGET_ prefix with uppercase flag names:
export GITGET_ROOT=/workspace/repositories
export GITGET_HOST=gitlab.com
export GITGET_SKIP_HOST=trueAdd a [gitget] section to your global Git configuration:
git config --global gitget.root /workspace/repositories
git config --global gitget.host gitlab.com
git config --global gitget.skip-host trueOr edit ~/.gitconfig directly:
[gitget]
root = /workspace/repositories
host = gitlab.com
skip-host = trueClone a repository:
git get facebook/react
# Clones to: ~/repositories/github.com/facebook/react/Clone to custom location:
git get --root /workspace golang/go
# Clones to: /workspace/github.com/golang/go/Clone specific branch:
git get --branch v1.19.0 golang/goSkip host directory:
git get --skip-host facebook/react
# Clones to: ~/repositories/facebook/react/List repositories with status:
git list --fetchGenerate backup list:
git list --out dump > backup-$(date +%Y%m%d).txtPermission denied (SSH):
# Make sure SSH keys are configured
ssh-add -l
# Or use HTTPS instead
export GITGET_SCHEME=httpsRepository not found:
# Check if repository URL is correct
git ls-remote https://github.com/user/repo.gitPath issues on Windows:
# Use forward slashes or double backslashes in paths
git get --root C:/workspace user/repoEnable verbose output:
# Set environment variable for debug logs
export GITGET_DEBUG=1
git get user/repo- Check our Issues for known problems
- Create a new issue if you need help
- Include output from
git get --versionand relevant error messages
We welcome contributions!
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Install dependencies:
go mod download - Make changes and add tests
- Format:
go fmt ./... - Build:
go build -o git-get ./cmd/ - Run tests:
go test ./... - Run linter:
golangci-lint run - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
Run the test suite:
# Run all tests
go test ./...
# Run tests with coverage
go test -race -coverprofile=coverage.out ./...
go tool cover -html=coverage.out
# Run specific package tests
go test -v ./pkg/git# Install golangci-lint (if not already installed)
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
# Run linting with the project's configuration
golangci-lint run
# Run with verbose output
golangci-lint run -v
# Fix auto-fixable issues
golangci-lint run --fixThis project is licensed under the MIT License - see the LICENSE.md file for details.
Inspired by:
- Go's
go getcommand for its elegant repository organization - ghq by x-motemen for repository management concepts
- multi-git-status by fboender for status display ideas
Built with: