Organize your local git repositories in a tree structure:
~/Projects
└── github
└── <GitHub org / username>
└── <GitHub repo name>
This project is highly inspired by this post. You can read it for more information.
npm install -g gitrees
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"
}
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