2 unstable releases

0.2.0 Jan 29, 2019
0.1.0 Dec 18, 2018

#1189 in Development tools

Download history 1/week @ 2024-02-17 14/week @ 2024-02-24 43/week @ 2024-03-30 11/week @ 2024-04-06

54 downloads per month


720 lines


git-project allows you to quickly and easily manage the large number of git projects that can accrue on a modern developer's computer.


$ cargo install git-project


$ git project -h
git-project 0.1.0
Nate Mara <nate.mara@kroger.com>
A manager for all of your git projects

    git-project <SUBCOMMAND>

    -h, --help       Prints help information
    -V, --version    Prints version information

    check              Check all repositories under the base path to ensure the are up to date with remotes
    clone              Clone a new project into a folder based on the remote URL
    gen-completions    Generate CLI completions for your shell of choice
    help               Prints this message or the help of the given subcommand(s)
    list               List all repositories under the base path
    organize           Organize an existing directory of git repositories into a normalized format based on remotes

Base Directory

All of the git-project subcommands accept a --base-dir or -d argument, or a GIT_PROJECT_BASE_DIR environment variable pointing to a directory where all of your git repositories are located.


git-project has several subcommands that each deal with a specific aspect of managing git repositories.

  • clone
  • check
  • list
  • organize
  • gen-completions

git project organize OLD_DIR NEW_DIR

This subcommand is used to organize a directory containing git repositories. Each repository will be placed into a folder based on its remote path. By default the "origin" remote is used, but if there is no origin, the first remote with a configured URL will be used. Here is a small example of how it can be used:

$ cd unorganized/foo
$ git init
$ git remote add origin https://github.com/Kroger-Technology/git-project.git

$ cd ../bar
$ git init
$ git remote add origin git@gitlab.internal.com/you/git-project.git

$ cd ../..
$ git project organize unorganized organized

$ git project list -d organized


Do not move any files, just print out the moves that this command will execute.

git project clone URL

This subcommand is used to clone a repository onto your computer. What's the difference between this, and a normal git clone? git project clone will automatically clone the project to a folder matching the URL that you give it!

  • https://github.com/Kroger-Technology/git-project.git is cloned to /base-dir/github.com/Kroger-Technology/git-project

  • git@gitlab.internal.com:you/git-project.git is cloned to /base-dir/gitlab.internal.com/you/git-project

Having your repositories in this format is not required for git-project's other subcommands to work.

git project check

This subcommand allows you to check the status of all git repositories under your base directory. This can be used to ensure that all changes on your computer are on a remote somewhere so that your work will not be lost if something happens to your computer.

$ git project check --summarize

- branch left-recursion does not exist on remote origin
- branch template-return does not exist on remote origin


- local changes not checked in
- local branch master ahead of origin/master by 4 commits


- local changes not checked in


- branch master does not exist on remote fork

---- Summary ---
Warnings: 6
Scanned repositories: 74
Repositories with warnings: 4
Repositories with no warnings: 70


The --deep-recurse flag works exactly the same for this command as with the list subcommand, but instead of just listing submodules, this command will check them.


This flag prints a summary of all the repositories scanned.

Warnings reported

  • Working directory changes not checked in to index
  • No remotes configured
  • Local branch has commits that remote does not have
  • Local branch does not exist on remote

git project list

This subcommand recurses the directory tree under your base directory and prints out every git repository it finds.

NOTE: by default, when encountering a .git folder, this search will stop recursing as an optimization. To search for submodules, use the --deep-recurse flag.

Here is an example directory tree:


And some example outputs

$ git project list

$ git project list --deep-recurse

git project gen-completions SHELL

This subcommand will generate autocomplete scripts for your shell of choice. Scripts will be printed to stdout. Current shell options are:

  • bash
  • zsh
  • fish
  • powershell
  • elvish


~427K SLoC