Skip to content

Instantly share code, notes, and snippets.

@yokawasa
Last active January 28, 2023 07:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yokawasa/54518cb79031e6cf2b9ae9212e7b6df9 to your computer and use it in GitHub Desktop.
Save yokawasa/54518cb79031e6cf2b9ae9212e7b6df9 to your computer and use it in GitHub Desktop.
ghq tips

ghq tips

setup

# install 
brew install ghq

# set ghq root dir
git config --global ghq.root '~/dev/ghq'

How to use ghq

clone repository

clone one by one

# SSH
ghq get git@github.com:hoge/hoge.git
# or you can get SSH with -p option
ghq get -p https://github.com/hoge/hoge.git

# HTTPS
ghq get https://github.com/hoge/hoge.git

clone all repos under a certain user or organiztion

ACCOUNT=yokawasa-sandbox
for i in $(gh repo list ${ACCOUNT} --no-archived --json url --jq '.[].url' ); do echo $i; ghq get -p $i ;done

list ghq managed repos

ghq list
# full path
ghq list -p

references

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment