cgit
is a utility that acts as a wrapper around git clone
, allowing you to organize project folders in a reverse domain-like structure.
Assuming you have a repository at https://gitsite.com/username/repo-name.git
, you can use cgit
as follows:
cgit https://gitsite.com/username/repo-name.git
This command is equivalent to:
git \
clone \
https://gitsite.com/username/repo-name.git \
com.gitsite.username.repo-name/repo_name
The format of th above commands is as follows:
git \
clone \
<repo url> \
<repo reverse domain folder>/<repo name>
cgit
is also compatible with repositories in the format: [email protected]:username/repo-name.git
.
To use cgit
, follow these steps:
-
Install Rust.
-
Globally install the
cargo-run-script
Rust crate:cargo install cargo-run-script
-
This will install the
cgit
executable globally in the/usr/local/bin
directory:cargo run-script install
-
After installation,
cgit
should be available in a new terminal session.