Skip to content

Instantly share code, notes, and snippets.

@typovrak
Last active June 23, 2025 16:28
Show Gist options
  • Select an option

  • Save typovrak/8034fe822905c3febbe4c3c9a84f065d to your computer and use it in GitHub Desktop.

Select an option

Save typovrak/8034fe822905c3febbe4c3c9a84f065d to your computer and use it in GitHub Desktop.
GitHub workflow management using only CLI (git + gh)

๐Ÿ–ฅ๏ธ Managing issues, PRs, and rebasing using only CLI (git + gh)

0. ๐Ÿ”ง Prerequisites

  • Navigate to your repository in terminal.
  • Ensure git and GitHub CLI (gh) are installed on your system.

1. ๐ŸŽซ Create an issue

gh issue create

This outputs the issue URL (https://github.com/owner/repo/issues/6) that contains the ISSUE_NUMBER (here 6).

Or to list all issues and find an existing issue number :

gh issue list

2. ๐ŸŒฟ Create a branch for the issue

gh issue develop ISSUE_NUMBER

3. ๐Ÿ”€ Switch to the new local branch

Use tab autocompletion to find the branch name :

git checkout ISSUE_NUMBER<TAB><TAB>

4. ๐Ÿ’ป Develop the feature in local

git add .
git commit -m "DESCRIPTION"
git push

(๐Ÿ”„ Repeat as needed)

5. ๐Ÿ“ค Open a PR linked to the issue

gh pr create 

The PR is automatically linked to the issue of the development branch.

6. ๐Ÿ”„ Rebase and merge the PR into main

gh pr merge

Select : Rebase and merge. (Optional : ๐Ÿ’พ Keep the branch if you want to)

The merge will automatically close the issue automatically after submit.

7. ๐Ÿ”ผ Update local main

git checkout main
git pull

๐ŸŽ‰ And that's it! You've completed the full GitHub workflow without leaving your terminal! ๐Ÿš€

Now, go install NixOS and be a great developer ๐Ÿ˜‰

@alexsan-dev
Copy link

super gist champion

@typovrak
Copy link
Author

100% tested, 100% functional.

Have a great journey with it !

@alexsan-dev
Copy link

alexsan-dev commented Jun 21, 2025

@typovrak yes i tested also , this gist is a life changer !

@typovrak
Copy link
Author

La vidรฉo oรน je suis le dรฉroulement en y donnant de nombreux conseils, bonnes pratiques est en ligne sur YouTube :
https://youtu.be/283uyisTOXk

Bon visionnage ;)

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