Skip to content

yuyinws/gitrees

Repository files navigation

Gitrees

npm version npm downloads License

Organize your local git repositories in a tree structure:

~/Projects
└── github
    └── <GitHub org / username>
        └── <GitHub repo name>

Kapture 2024-01-24 at 09.40.50

Why

This project is highly inspired by this post. You can read it for more information.

Usage

Install

npm install -g gitrees

init config

gt init

It will generate a config file named .gtrc.json on your home directory:

{
  // Alias for remote git repository address
  "alias": {
    "github.com": "github",
    "gitlab.com": "gitlab",
    "you-company.com": "company"
  },
  // Root directory for storing all local repositories.
  "root": "/Users/hostname/Projects"
}

Clone a repository

gt clone https://github.com/vuejs/core.git

Will convert to:

git clone https://github.com/vuejs/core.git /Users/hostname/Projects/github/vuejs/core

gt clone https://your-company.com/test/demo.git

Will convert to:

git clone https://your-company.com/test/demo.git /Users/hostname/Projects/company/test/demo

License

MIT License © 2023-PRESENT yuyinws

About

Organize your local git repositories in a tree structure.

Resources

License

Stars

Watchers

Forks

Packages

No packages published