Skip to content

thecasualcoder/gg

Repository files navigation

Git Governance

Build Status

A tool to manage multiple git repositories. This does not aim to replace git in any way but tries to reduce the work in managing multiple git repositories at once. To know about the story behind this tool, take a look at this blog -> https://medium.com/@jpninanjohn/we-built-a-tool-in-rust-9c1bcb9b655e

Installation

Using Brew:

brew tap thecasualcoder/stable
brew install gg

Installing from source:

git clone https://github.com/thecasualcoder/gg.git
cd gg
cargo install --path .

Note: Recommaded rustc/cargo version: 1.36.0 and above or 1.37.0-nightly and above

Usage:

Help:
$ gg --help

Help

Status:

Shows status of all git repos from current directory. Traverses inside directories also. To traverse through hidden directories use the -i flag. By default hidden directories will not be traversed.

$ gg status

Status

Create:

Creates a remote repository and clones it to the local path specified. Remote repository is created based on the GITHUB_TOKEN provided. GITHUB_TOKEN can be passed as an env variable or can be given as an argument through the -t flag

$ gg create -r <repo_name> -l <local_path>

Create

Fetch:

Fetches from all git repositories starting from current directory. Traverses inside directories also. Currently Fetch only uses the private key id_rsa to authenticate and will fail to fetch if it is not enough. Failure to fetch one repo will not fail others To traverse through hidden directories use the -i flag. By default hidden directories will not be traversed.

$ gg fetch 

Fetch

Clone:

Clones repositories based on the flags passed and the configuration given in the .ggConf.yaml file.

$ gg clone -r <remote_url_1> -r <remote_url_2> -l <local_path>  

Clone

Config file:

The config file can be specified via the -c flag. By default it tries to find .ggConf.yaml. Example config file:

skipDirectories:
  - ignore
cloneRepos:
  - remoteURL: https://github.com/golang/net.git
    localPath: here/net
  - remoteURL: https://github.com/golang/net.git
    localPath: there/net
ssh:
    privateKey: '/home/ninan/.ssh/gg'
    username: 'git'
    ssh_agent: false

See .ggConf.example.yaml for more details

Contributing:

Please refer the github projects board If you want some feature, please create an issue and if possible feel free to raise PR too.