Git Product home page Git Product logo

gitall.rs's Introduction

gitall

gitall recursively finds all repositories below a directory and runs the given Git command in each repository in parallel.

Build Status

Usage

The simplest form is to cd to a directory containing all the repos you want to operate on, then write your Git command changing git to gitall. To pass options to the Git command, you must add -- before your command to tell gitall to stop parsing its own options and pass them to Git. For example, to list all remote and local repository branches you need to run gitall -- branch -va.

Pro Tip: if you add a file called git-foo to your PATH (either via copying or symlinking), you can call that program through git using git foo; no additional aliases or setup needed. So, after running ln -s /usr/bin/gitall /usr/bin/git-all, you can use gitall via git all exactly the same as if you used gitall.

Examples

Print the latest commit SHA:

Fetch the latest changes for all your repositories under ~/code:

$ cd ~/code
$ gitall fetch origin
/home/matt/code/gitall.rs
From github.com:mattmahn/gitall.rs
   17acab9..8994d3c  master     -> origin/master
 * [new branch]      windows-build -> origin/windows-build

/home/matt/code/jsonapi-server
From github.com:holidayextras/jsonapi-server
 * [new branch]      greenkeeper/debug-4.1.1 -> origin/greenkeeper/debug-4.1.1
 * [new branch]      greenkeeper/eslint-plugin-node-8.0.0 -> origin/greenkeeper/eslint-plugin-node-8.0.0
 * [new branch]      greenkeeper/jscpd-0.6.25 -> origin/greenkeeper/jscpd-0.6.25
 * [new branch]      greenkeeper/jscpd-1.0.0 -> origin/greenkeeper/jscpd-1.0.0
 * [new branch]      greenkeeper/jscpd-1.0.1 -> origin/greenkeeper/jscpd-1.0.1
 * [new branch]      greenkeeper/jscpd-1.0.2 -> origin/greenkeeper/jscpd-1.0.2
 * [new branch]      greenkeeper/jscpd-1.0.3 -> origin/greenkeeper/jscpd-1.0.3
 * [new branch]      greenkeeper/jscpd-1.1.0 -> origin/greenkeeper/jscpd-1.1.0
 * [new branch]      greenkeeper/jscpd-1.2.0 -> origin/greenkeeper/jscpd-1.2.0
 * [new branch]      greenkeeper/jscpd-1.2.1 -> origin/greenkeeper/jscpd-1.2.1
 * [new branch]      greenkeeper/jscpd-1.2.2 -> origin/greenkeeper/jscpd-1.2.2
 * [new branch]      greenkeeper/jscpd-1.2.3 -> origin/greenkeeper/jscpd-1.2.3
 * [new branch]      greenkeeper/jscpd-2.0.0 -> origin/greenkeeper/jscpd-2.0.0
 * [new branch]      greenkeeper/jscpd-2.0.1 -> origin/greenkeeper/jscpd-2.0.1
 * [new branch]      greenkeeper/jscpd-2.0.2 -> origin/greenkeeper/jscpd-2.0.2
 * [new branch]      greenkeeper/jscpd-2.0.3 -> origin/greenkeeper/jscpd-2.0.3
 * [new branch]      greenkeeper/jscpd-2.0.4 -> origin/greenkeeper/jscpd-2.0.4
 * [new branch]      greenkeeper/qs-6.6.0 -> origin/greenkeeper/qs-6.6.0
 * [new branch]      mast       -> origin/mast

Alternatively, you can run gitall -D ~/code fetch origin from any directory.

Options

Executes git(1) commands in repos below a parent directory

USAGE:
    gitall [FLAGS] [OPTIONS] <COMMAND>...

FLAGS:
    -L, --follow     Follow symbolic links
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
        --color <WHEN>          Controls when to use color [default: auto]  [possible values: always, true, auto, never, false]
    -D, --directory <DIR>       The directory to start searching under [default: .]
    -d, --max-depth <LEVELS>    Descend at most LEVELS of directories below DIR
    -r, --regex <regex>         Filters command to repo(s) matching provided Regex [default: .*]

ARGS:
    <COMMAND>...    A single git command to run in each repo

Installation

Dependencies:

  • Git
  • Rust & Cargo (for build only)

You can install gitall from crates.io with

$ cargo install gitall

Or download pre-built binaries for some platforms on the releases page. After extracting the release artifacts, move the gitall executable to some directory in your PATH. Refer to your shell's documentation for installing the completion scripts located in complete/.

From source

Clone this repository, build gitall, then copy the executable to a directory in your PATH:

$ git clone https://github.com/mattmahn/gitall.rs && cd gitall.rs
$ cargo build --release
# install target/release/gitall /usr/bin/

Shell completions for Bash, Zsh, fish, Elvish, and PowerShell are also generated during build; you can find them at target/release/build/gitall-<hash>/out/. Refer to your shell's documentation for installation.

gitall.rs's People

Contributors

mattmahn avatar awkewainze 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.