Skip to content

Instantly share code, notes, and snippets.

@rwp0
Last active February 22, 2024 16:06
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rwp0/122330fa414877778dc6a20f183e1bcb to your computer and use it in GitHub Desktop.
Save rwp0/122330fa414877778dc6a20f183e1bcb to your computer and use it in GitHub Desktop.
GH CLI Transfer Repository Ownership Alias
# ~/.config/gh/config.yml
# What protocol to use when performing git operations. Supported values: ssh, https
git_protocol: https
# What editor gh should run when creating issues, pull requests, etc. If blank, will refer to environment.
editor:
# When to interactively prompt. This is a global config that cannot be overridden by hostname. Supported values: enabled, disabled
prompt: enabled
# A pager program to send command output to, e.g. "less". Set the value to "cat" to disable the pager.
pager:
# Aliases allow you to create nicknames for gh commands
aliases:
co: pr checkout
transfer: api repos/$1/transfer -f new_owner=$2
# The path to a unix socket through which send HTTP connections. If blank, HTTP traffic will be handled by net/http.DefaultTransport.
http_unix_socket:
# What web browser gh should use when opening URLs. If blank, will refer to environment.
browser:
gh alias \
set transfer 'api repos/$1/transfer -f new_owner=$2'
# gh alias list
# gh alias set --help
# https://github.com/cli/cli/issues/5292
# https://cli.github.com/manual/gh_alias_set
# https://cli.github.com/manual/gh_api
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment