项目作者: sei40kr

项目描述 :
Clone a GitHub repository into your workspace with one command!
高级语言: Shell
项目地址: git://github.com/sei40kr/zsh-gh-clone.git
创建时间: 2019-12-23T16:06:21Z
项目社区:https://github.com/sei40kr/zsh-gh-clone

开源协议:MIT License

下载


zsh-gh-clone

Clone a GitHub repository into your workspace with one command!

Example

  1. GH_CLONE_WORKSPACE_DIR=~/develop/workspace
  2. GH_CLONE_DEFAULT_GITHUB_USER=sei40kr
  3. # equivalent to `git clone https://github.com/sei40kr/dotfiles ~/develop/workspace/sei40kr/dotfiles`
  4. gh-clone dotfiles

Install

  1. zinit ice trigger-load'!gh-clone'
  2. zinit light sei40kr/zsh-gh-clone

Install with zplug

  1. zplug sei40kr/zsh-gh-clone

Customization

Variable Default Value Description
GH_CLONE_WORKSPACE_DIR '' Workspace directory where you clone repositories
GH_CLONE_DEFAULT_GITHUB_USER "$(git config github.user)" Default GitHub user. If username omitted, this will be used instead.

Tips

Clone a repository of yours via SSH

Configure your .gitconfig like shown below:

  1. [url "git@github.com:sei40kr"]
  2. insteadOf "https://github.com/sei40kr"

Use different keys for different GitHub users

Configure your .gitconfig like shown below:

  1. [url "git@github-private:sei40kr"]
  2. insteadOf "https://github.com/sei40kr"
  3. [url "git@github.com:sei40kr-work"]
  4. insteadOf "https://github.com/sei40kr-work"

Then specify a key to use in your .ssh/config too:

  1. Host github-private
  2. HostName github.com
  3. User git
  4. IdentityFile ~/.ssh/id_rsa_private

You also need to make sure the permission for .ssh/config set properly:

  1. chmod 600 ~/.ssh/config

Similar Projects