Skip to content

syz51/gitsync

Repository files navigation

gitsync

npm version license node

CLI tool that scans directories for git repos and reports their sync status.

Demo

Why gitsync?

Working across multiple git repositories? It's easy to forget uncommitted changes, unpushed commits, or branches without upstreams.

gitsync gives you a quick overview of all repos in a directory so nothing falls through the cracks.

Features

  • Detect uncommitted changes
  • Track ahead/behind status vs remote
  • Find branches without upstream tracking
  • Multiple output formats: JSON, table, minimal
  • Recursive directory scanning
  • Config file support (cosmiconfig)

Install

npm install -g @roeus/gitsync

Or build locally:

git clone https://github.com/syz51/gitsync.git
cd gitsync
pnpm install
pnpm run build
pnpm link --global

Usage

gitsync [options] [paths...]

Options

Flag Description
-a, --all Show all repos (not just outstanding)
-f, --format <type> Output: json, table, minimal (default: json)
-q, --quiet Suppress output
-r, --recursive Scan recursively
-d, --depth <n> Max depth (default: 1)
--include-hidden Include hidden directories
--filter <types> Filter: changes,ahead,behind,untracked
--dir <path> Config file search directory

Examples

# scan current dir, show only repos with issues
gitsync

# show all repos as table
gitsync -a -f table

# recursive scan, filter to repos with uncommitted changes
gitsync -r --filter changes

# scan specific directories
gitsync ~/projects ~/work

# combine filters
gitsync --filter changes,ahead

Config File

Supports .gitsyncrc, .gitsyncrc.json, .gitsyncrc.yaml, gitsync.config.js, or package.json field.

Example .gitsyncrc.json:

{
  "format": "table",
  "recursive": true,
  "depth": 2
}

CLI args override config file values.

Output

By default shows repos with issues:

  • uncommitted changes
  • ahead/behind remote
  • no upstream
  • untracked branches

JSON (default)

[{"name": "repo", "uncommittedChanges": 3, "ahead": 1, ...}]

Table

REPO     BRANCH  CHANGES  AHEAD  BEHIND  UNTRACKED
my-repo  main    3        1      0       feature-x

Minimal

my-repo (main): 3 changes, 1 ahead, [feature-x]

Requirements

  • Node.js >= 24
  • git

Development

git clone https://github.com/syz51/gitsync.git
cd gitsync
pnpm install
pnpm run build

# test locally
pnpm link --global
gitsync

Contributing

  1. Fork the repo
  2. Create a feature branch
  3. Make changes
  4. Submit a PR

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors