Skip to content

A bash script to run git commands against a specified directory path. If the path is a repo it will run the git command on that repo. If the path is not a repo, it will search the sub-directories for repos and run the git command on all of them.

License

Notifications You must be signed in to change notification settings

jmaxwilson/git-dir

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

git-dir

git-dir is a bash script that you can use to run a git command on all of the git repos in a specified directory path.

Installation

Copy the git-dir script into a directory in your execution path:

sudo cp git-dir /usr/local/bin

Make sure that it is executable:

sudo chmod +x /usr/local/bin/git-dir

Add support for git command tab completion for git-dir on Linux:

echo "_xfunc git __git_complete git-dir __git_main" >> ~/.bash_completion

(Enabling tab completion on Mac is more complicated)

Usage

git-dir [git command and options] [path]

If the specified path is a repo, git-dir will run the git command on that repo.

git-dir pull --verbose /dev/repos/mycode

If the path is not a repo, git-dir will search all of the sub-directories in the path for git repos and give you the option to run the git command on all of them.

git-dir pull /dev/repos/

Demo

Animated GIF of using git-dir to run git commands on multiple repositories at once

About

A bash script to run git commands against a specified directory path. If the path is a repo it will run the git command on that repo. If the path is not a repo, it will search the sub-directories for repos and run the git command on all of them.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages