简体   繁体   中英

How to clone github repo using just the username and repo name?

I remember seeing this somewhere but cannot find it now. It was (maybe?) a wrapper for git that added some additional functionalities such as the ability to clone repos from GitHub by only using the username and repo name similar to AUR helpers (such as yaourt and yay) the syntax was this:

git clone username/repo

and it would perform clone on https://github.com/username/repo.git

any help will be appreciated 🙂.

我猜你在谈论枢纽

You can use a git alias that uses the native shell and concatenates the argument to a git clone command. Just add the following under the [alias] section of your .gitconfig :

hubclone = "!git clone https://github.com/${1}.git"

And you'd be able to use commands like this:

$ git hubclone apache/commons-collections

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM