Command Reference
GitHub CLI (gh)
Read Operations
View Token
gh auth tokenView Auth Status
gh auth statusSearch Repo by Owner
gh search repos --owner <USERNAME>Search Repo without any flags
gh repo listList secrets
gh secret listList all open PRs
gh pr listCopy PR from Web to local
gh pr checkout <NUMBER>View difference in PR
gh pr diffWrite Operations
Authentication with PAT
gh auth login -p https --with-token < tokenCreate secret
gh secret set <SECRET-NAME>Create pull request from local
gh pr create --base <DEFAULT-BRANCH> --head <NEW-BRANCH-NAME> --title '<PR-TITLE>' --body '<PR-COMMENT>'Merge PR from local
gh pr mergeGit CLI (git)
Read Operations
TBC
Write Operations
Create a new branch
git checkout -b <NEW-BRANCH-NAME>
git push --set-upstream origin <NEW-BRANCH-NAME>Switch branch
git switch <BRANCH-NAME>Add files to GIT
git add .Commit
git commit -m '<MESSAGE>'Push to GitHub web
git pushPush changes from another branch
git push -u https://github.com/<USERNAME>/<REPOSITORY> <[NEW]BRANCH-NAME>Pull Origin Branch (In Cases of Difference)
git fetch originRebase Branch
git rebaseClone Repo
git clone <https://GIT_URL/REPO/>Last updated
Was this helpful?