-
Install {% data variables.product.prodname_cli %} on macOS, Windows, or Linux. For more information, see Installation in the {% data variables.product.prodname_cli %} repository.
-
Authenticate with {% data variables.product.company_short %} by running this command from your terminal.{% ifversion ghes %} Replace
HOSTNAME
with the name of {% data variables.location.product_location %}. For example,octo-inc.ghe.com
.{% endif %}{%- ifversion fpt or ghec %}
gh auth login
{%- else %}
gh auth login --hostname HOSTNAME
{%- endif %}
-
Follow the on-screen prompts.
{% data variables.product.prodname_cli %} automatically stores your Git credentials for you when you choose HTTPS as your preferred protocol for Git operations and answer "yes" to the prompt asking if you would like to authenticate to Git with your {% data variables.product.prodname_dotcom %} credentials. This can be useful as it allows you to use Git commands like
git push
andgit pull
without needing to set up a separate credential manager or use SSH.