Skip to main content

Scan local or remote git repositories for history divergent from origin

Project description

Git-Scan

Git-Scan is a command-line utility to scan local or remote git repositories for history that is divergent from the remote branch. It is particularly useful when dealing with multiple git repositories across multiple machines where pulls and pushes are missed, stashes are forgotten about, files are left untracked, etc.

Features

  • Scan repositories for missing push & pulls, uncommited changes, untracked files, leftover stashes, and dangling branches
  • Automatically pull or push a group of repositories
  • Open repositories in need of changes in TMUX windows
  • Execute over SSH to git-scan on a different computer
  • Configuration file to list scannable repositories

Usage

To run a git-scan

git-scan [--push] [--pull] [--repo] [--tmux] [--ssh]

where the optional arguments are

  • push: push repository changes if ahead of remote
  • pull: pull repository changes if behind remote and there are no merge conflicts
  • repo: list of repositories to scan (defaults to all in the configuration file)
  • tmux: open all repositories with problems to fix in a TMUX window
  • ssh: run the git-scan on the provided ssh host

To add a repository to the list of scannable repositories

git-scan add /path/to/repository

To remove a repository

git-scan remove /path/to/repository

To list all scannable repositories

git-scan list [--resolve]

Installation

Clone the repository

git clone https://github.com/johnaparker/git-scan.git && cd git-scan

and install with pip

pip install .

If installed with the --user flag, make sure to add ~/.local/bin to your PATH

Configuration File

A configuration file located at ~/.config/git-scan/git-scan.conf is created. This is a TOML file listing the scannable repositories:

repositories = ["/path/to/repository_1", "/path/to/repository_2"]

The config file can be editted manually or changed using the add and remove commands. Glob patterns and tilde expansions are allowed, i.e. "~/path/to/repos/*"

License

Git-Scan is licensed under the terms of the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

git-scan-0.1.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

git_scan-0.1-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file git-scan-0.1.tar.gz.

File metadata

  • Download URL: git-scan-0.1.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.3

File hashes

Hashes for git-scan-0.1.tar.gz
Algorithm Hash digest
SHA256 edfd14e6b4d24b79451f5b5b0ff11a71c73a1cca286ea64217d24ada8b663dec
MD5 588109a2d861ae722ee9e5eaabb74062
BLAKE2b-256 6c0894bca4a01db4729017b790cb651059b8f3c77aad54113e7a3e25bf5c2a02

See more details on using hashes here.

File details

Details for the file git_scan-0.1-py3-none-any.whl.

File metadata

  • Download URL: git_scan-0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.3

File hashes

Hashes for git_scan-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 40c62d2d1c4f7c875382e46e58f58d25aa26db5a76f4620b7d0c33b7da60c57b
MD5 f343144f7ba4ba2101378a5f43f5674a
BLAKE2b-256 e8cb53f10fb68393e103c96a1376b6d27ea3cdaa93713c1fd89730c1acc4c907

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page