- Rust 83.1%
- Nix 16.9%
| nix | ||
| src | ||
| .dep | ||
| .envrc | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| flake.lock | ||
| flake.nix | ||
| README.md | ||
Gull
A simple CLI to clone git repositories from diffrent domains.
gulloriginally stands forgit pulland it was to late when i found out this makes no sense.
Motivation
The first version was used to fasten git cloning for me as all my repos were on gitlab.sk13.xyz/tt14 and this was a lot to type.
Today I have repos across multiple domains all with diffrent usernames / emails.
gull is aimed simplify the setup process for all this domains.
Usage
Overview of all commands.
This might not be up to date. Use
gull helpfor a better overview of commands and usage information.
Add domain
$ gull add NAME --url DOMAIN --name USER --mail E-MAIL
This will add a domain with a specific username and email only for this domain. When cloning a repo from this domain with gull, the given username and email will be set to the local git config.
List domains
$ gull ls
This will list all known domains with username and emails.
Remove domain
$ gull rm DOMAIN
This will remove the doamin from the known domain list.
Clone repo
$ gull clone REMOTE LOCAL
This will clone a git repository.
The command accepts between 1 and 2 arguments. These will be used to determin from where to clone and where to local clone should be placed.
Remote Repo
If the remote location starts with https:// the URL will be taken as-is and passed to git clone.
A missing .git at the end will not be appanded.
Afterwards domain specified after https:// will be used to match agains known domains (the url part).
If a known domain is found, the local username & email will be set, otherwise a warning will be shown.
If the remote location does not start with https:// the domain will be made up of parts:
- domain (the name part)
- namespace
- project
The location follows these rules:
- parts are splitted by a
/ - if the last part does not have a
.gitat the end it will be appanded - if only 2 parts are specified:
- layout is considered
DOMAIN/PROJECT - namespace will be autofilled to the username of the domain
- layout is considered
If the domain is not known, the cli will error. If it is found the local username & email will be set.
Examples
Given domains:
gitlab- url:
gitlab.sk13.xyz - user:
tt14 - email:
tt14@example.com
- url:
gta- url:
git.solarpunk.social - user:
krauterbaquette - email:
krauterbaquette@example.com
- url:
$ gull clone gitlab/gull
> git clone gitlab.sk13.xyz/tt14/gull.git
> git config --local user.name tt14
> git config --local user.email tt14@example.com
gull clone gta/GTA-HEG/SAC
> git clone git.solarpunk.social/GTA-HEG/SAC.git
> git config --local user.name krauterbaquette
> git config --local .user.email krauterbaquette@example.com
Local Repo
The local location can be specified by a second argument.
It behaives exactly the same as the second argument to git clone.
$ gull clone REMOTE local
Will clone the REMOTE repo to {CWD}/local.