Skip to content

A tool to help quickly select an SSH host for git clone and git remote. ๐Ÿ™

License

Notifications You must be signed in to change notification settings

jnbdz/gitmultihost

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

7 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

gitmultihost

Shell tool to facilitate the usage of git in a context where you have multiple hosts in your ~/.ssh/config.

This script automatically catches the HTTPS or the SSH url and then using fzf (general-purpose command-line fuzzy finder) to give you a quick way to select a host that is in ~/.ssh/config.

Install

sudo make install

How-to

Cloning a repo

gitmultihost clone git@github.com:user/repo.git

What follows is fzf listing the hosts. After selecting a host it will change the github.com (or any other domain name) with the host selected.

Changing the remote origin

This is useful if there are already repositories that have not been configured to used one of the hosts.

gitmultihost remote set-url origin git@github.com:user/repo.git

It will do the same as cloning and will ask you with fzf what host you want to use.

Any Other Command

Those were just examples of what can be done with the tool. Any other git command can be used and every time there is a HTTPS or a SSH url it will give the option to select a different host based on what is in ~/.ssh/config.

About

A tool to help quickly select an SSH host for git clone and git remote. ๐Ÿ™

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published