将 git 仓库克隆到由域和路径组织的标准位置。
[!IMPORTANT]
Moved to Codeberg .
⤵️
Git Grab
Git Grab clones a repo into $GRAB_HOME, organised by domain and path.
GRAB_HOME defaults to ~/src if not set or supplied via the --home
argument. For example:
$ git grab github.com/wezm/git-grab
Cloning into '/home/wmoore/src/github.com/wezm/git-grab'...
remote: Enumerating objects: 30, done.
remote: Counting objects: 100% (30/30), done.
remote: Compressing objects: 100% (20/20), done.
remote: Total 30 (delta 9), reused 27 (delta 7), pack-reused 0
Receiving objects: 100% (30/30), 12.50 KiB | 12.50 MiB/s, done.
Resolving deltas: 100% (9/9), done.
Grabbed https://github.com/wezm/git-grab to /home/wmoore/src/github.com/wezm/git-grab
$ lsd --tree ~/src
/home/wmoore/src
└── github.com
└── wezm
└── git-grab
├── Cargo.lock
├── Cargo.toml
└── src
├── args.rs
├── grab.rs
└── main.rsPre-compiled binaries are available for a number of platforms:
Check the [latest release] for download links.
git-grab is packaged in these package managers:
git-grabbrew install git-grabgit-grabOnce git-grab in installed you can use it via git grab. git automatically
finds binaries named git-*, this also means that if you have a shell alias
like alias g=git, g grab will also work.
…A man page is also available in the source distribution.
Configure an alias in the GitHub CLI:
gh alias set --shell grab 'git grab "[email protected]:$1.git"'
You can now grab a GitHub repo. For example:
gh grab wezm/git-grabMinimum Supported Rust Version: 1.82.0
git-grab is implemented in Rust. See the Rust website for instructions on
installing the toolchain.
Compile-time Options (Cargo Features)
git-grab supports the following compile-time options:
clipboard: enable support for cloning the URL on the clipboardBuild the binary with cargo build --release --locked. The binary will be in
target/release/git-grab.
cargo install git-grab
This tool is inspired by grab by @jmhodges. A small comparison:
| Feature | Original | This Version |
|---|---|---|
| VCS Supported | Git, Mercurial, Subversion, and Bazaar | Git |
| Dependencies | None | git |
| Progress Information | No | Yes, provided by git |
git-grab incorporates clipboard code from clipp by bendn under the MIT licence.
This project is dual licenced under either of:
at your option.
暂无开放 Issues,或尚未同步最近议题。