1. Authentication and SSH Configuration
ssh -T git@github.comWhat it doesTests the connection from your local SSH key to GitHub and confirms that your account is recognized
When to use itAfter generating or adding a new SSH key in GitHub settings
Example
ssh -T git@github.comgit remote set-url origin <url>What it doesChange the registered remote address (eg switching from HTTPS to SSH)
When to use itto switch to SSH authentication and avoid the Personal Access Token request
Example
git remote set-url origin git@github.com:OWNER/REPO.gitgit remote add origin <url>What it doesLinks the local repository to a new remote repository on GitHub
When to use itWhen a new local repository is uploaded for the first time
Example
git remote add origin git@github.com:OWNER/REPO.gitgh auth loginWhat it doesStarts an interactive wizard to log in to your GitHub account via browser or token
When to use itWhen setting up the GitHub CLI for the first time on your machine
Example
gh auth logingh auth statusWhat it doesDisplays the login status, username, and protocol used in the GitHub CLI
When to use itto check the validity of the session and currently active account
Example
gh auth statusgh auth refresh -s <scope>What it doesUpdate session permissions to add new scopes (such as workflow or write:packages permissions)
When to use itWhen an order is rejected due to a lack of token permissions
Example
gh auth refresh -s workflow