#git-repository #git-config #user #simplifies #ssh-key

bin+lib gitez

Gitez is a CLI that simplifies managing your Git repositories

3 releases

0.1.2 Jun 15, 2024
0.1.1 Jun 15, 2024
0.1.0 Jun 15, 2024

#267 in Configuration

MIT license

24KB
614 lines

gitez

Crates.io

Gitez(ez means easy) is a CLI that simplifies managing your Git repositories.

Installation

Cargo

cargo install gitez
Macos and Linux

Coming soon...

Windows

Coming soon...

Features

Clone Repository

gitez provides a simple way to manage your git repositories.

$BASE
|- github.com
|  `- group-name
|     `- project-name
`- gitlab.com
   `- group-name
      `- project-name

First, you need to set the base directory where you want to store your repositories.

gitez set-base-dir <your-base-dir> # gitez set-base-dir ~/dev

Second, clone a git repository.

gitez clone <repository-url> # gitez clone https://github.com/luhc228/gitez

Then, you will get the following directory structure.

$BASE
`- github.com
   `- luhc228
      `- gitez

Manage Git User Config

Do you ever have one more git user configs( for example one is for open source(GitHub) and another is for Work(GitLab))? And you use different username and email for your commits at work or for your open source repositories by mistake?

gitez helps you manage and switch your git user configs easier.

First, you need to add your git user configs.

gitez user-config add

# see the list of your git user configs you added
gitez user-config list

Second, you can set a directory that uses one of yor git user configs.(powered by gitdir config)

gitez user-config add-include <user-config-name> # gitez user-config add-include
$BASE
`- github.com  # use github user config(name<a@example.com>)
`- gitlab.com  # use gitlab user config(name<b@example.com>)

Also, you can apply one of your git user configs to the current directory.

gitez user-config apply <user-config-name> # gitez user-config apply

Generate SSH Key

You can generate an SSH key for your git repositories by the following command:

gitez ssh-keygen

It will also add the SSH private key to the ~/.ssh/config so that you can manage different SSH private keys for different git repositories.

Dependencies

~16–27MB
~473K SLoC