clone is an app to manage cloning of different repositories using a predefined
host and path to clone to. It's not a big deal, but it's useful for my workflow
of clonning different repositories from different sources using different ssh
keys so I don't have to remember all the configs or cat the file everytime.
clone is useful for listing hosts, and managing "workspaces" as well as
clonning repositories under those workspaces. Now, what is a workspace: A
workspace is a record of some host and path to clone to. Prehaps you have seen
ssh config files with the following contents:
Host github.com-personal
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa
Host github.com-work
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_work
Of course, with many more configurations that eventually become hard to remember
each time you need to clone a repo. A host is then the string
gibhub.com-personal. The path can be any valid path you can write to in your
os
clone will write a file into your .config folder called clone.yaml where
it will store all the workspaces so you can check there as well if you want to
have a look.
As of now, the only way to use clone locally is to build it and install it.
Luckily, it's very simple, you can install it directly with the github url:
go install github.com/JulianH99/cloneor, you can download it, and install from the source code locally
- Clone the repo with
git clone https://github.com/JulianH99/clone.git cd clone && go mod downloadgo install .
if you have your $GOPATH set up correctly, you should be able to run clone
without issues
An AUR package is soon to come
Command shape:
clone [owner/repo] This will ask the user to choose a host and a workspace, with the posibility to
choose no workspace. It is important to note that a host is required, otherwise
this program makes no sense and you can just use git clone as normal.
This command offers the following options as well:
clone [owner/repo] -w [worspkace] -s [host] -p [customPath]
-
-wwill take the workspace name and will not ask for the worskpace again in the form -
-twill take the host name and will not ask for the host again in the form. You can type the hole form or just the hostname (e.g.github.com-personalor justpersonal) -
-pwill be a custom path to git clone to and will take precedence over the workspace's path
You can list available host names in your ~/.ssh/config file
clone hosts
This will show a list of all the hosts inside the ~/.ssh/config file, the same
list appears of course when you run clone [owner/repo] without additional
arguments
you can create, list, edit, and delete workspaces
clone workspaces list
clone workspaces edit [workspaceName]
clone workspaces delete [workspaceName]
clone workspace create
if there's any feature you'd like to see implemented, feel free to open an issue. This project is still under development but I think it's stable enough
- origin assignment, for cases like
git remote add origin git@github.com-domain:owner/repo.git, with an interface likeclone [owner/repo] -r [remoteName]