GithubHelp home page GithubHelp logo

hholzgra / multi-git-status Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fboender/multi-git-status

0.0 2.0 0.0 173 KB

Show uncommitted, untracked and unpushed changes for multiple Git repos

License: MIT License

Shell 71.56% Roff 28.44%

multi-git-status's Introduction

mgitstatus

Show uncommited, untracked and unpushed changes in multiple Git repositories. Scan for .git dirs up to DEPTH directories deep. The default is 2. If DEPTH is 0, the scan is infinitely deep.

mgitstatus shows:

  • Uncommitted changes if there are unstaged or uncommitted changes on the checked out branch.
  • Untracked files if there are untracked files which are not ignored.
  • Needs push (BRANCH) if the branch is tracking a (remote) branch which is behind.
  • Needs upstream (BRANCH) if a branch does not have a local or remote upstream branch configured. Changes in the branch may otherwise never be pushed or merged.
  • Needs pull (BRANCH) if the branch is tracking a (remote) branch which is ahead. This requires that the local git repo already knows about the remote changes (i.e. you've done a fetch), or that you specify the -f option. mgitstatus does NOT contact the remote by default.
  • X stashes if there are stashes.

Since there are a lot of different states a git repository can be in, mgitstatus makes no guarantees that all states are taken into account.

mgitstatus can also list dirs that are not a repo, if given the -w switch. To ignore certain repos, set the mgitstatus.ignore git config flag for that repo to true. (See "usage" below for an example).

Usage

Usage: mgitstatus [--version] [-w] [-e] [-f] [--no-X] [DIR] [DEPTH=2]

Scan for .git dirs under DIR and show git status. The scan goes 2
directories deep by default or the number specified by DEPTH deep.
If DEPTH=0, the scan is infinitely deep.

  --version   Show version
  -w          Warn about dirs that are not Git repositories
  -e          Exclude repos that are 'ok'
  -f          Do a 'git fetch' on each repo (slow for many repos)
  -c          Force color output (preserve colors when using pipes)

You can limit output with the following options:

  --no-push
  --no-pull
  --no-upstream
  --no-uncommitted
  --no-untracked
  --no-stashes

The following example scans all directories under the current dir, with a depth of 2. That means the current dir and all directories directly under it.

~/Projects/fboender $ mgitstatus 
./mgitstatus: ok 
./mdpreview: ok 
./snippets: ok 
./boxes: ok 
./ansible-cmdb: Uncommitted changes Untracked files 
./scriptform: Uncommitted changes 

To scan deeper (three dirs instead of two) in the current dir:

~/Projects $ mgitstatus . 3
./megacorp/ansible: ok 
./megacorp/monitoring: ok 
./fboender/mgitstatus: ok 
./fboender/mdpreview: ok 
./fboender/snippets: ok 
./fboender/boxes: ok 
./fboender/ansible-cmdb: Uncommitted changes Untracked files 
./fboender/scriptform: Uncommitted changes 
./fboender/startpage: ok 

The following command scans three levels deep in /opt/deploy/ and hides repos that are 'ok'. It does not show stashes:

$ mgitstatus -e --no-stashes /opt/deploy 3

To ignore a repo, set the mgitstatus.ignore git configuration option for that repo to true. E.g.:

$ cd stupidrepo
$ git config --local mgitstatus.ignore true

Installation

mgitstatus requires a POSIX compliant shell. Bash will do fine.

  1. Clone this git repo
  2. Copy mgitstatus somewhere in your PATH

Or follow these instructions:

$ curl -s -o mgitstatus https://raw.githubusercontent.com/fboender/multi-git-status/master/mgitstatus
$ chmod 755 mgitstatus
$ sudo mv mgitstatus /usr/local/bin/

License

mgitstatus is released under the MIT license.

multi-git-status's People

Contributors

fboender avatar bexelbie avatar bradym avatar rolfkleef avatar vst avatar ssimmen avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.