Track 05 · Lesson 7 of 7Working as a team with Git
Track 05 · Working as a team with Git
Everyday extras
Lesson 7 of 7· 6 min
The small commands that make every day smoother: report a bug without losing focus, see what's waiting for you, jump to the browser, and run a deploy by hand. Then, your whole toolbox in one search box.
I found a bug but can't fix it right now#
When: You noticed something broken while working on something else.
Type this and press Enter.
Commands to copy
$ gh issue createStep by step
$ gh issue create --title "Signup button does nothing on Safari" --label bug --body "Steps: open /signup on Safari, click Sign up. Nothing happens."All in one line
What's waiting for me today?#
When: Start of the day, or coming back from a break.
PRs in this repo that involve you.
Commands to copy
$ gh statusEverything that needs you, across repos
$ gh pr statusPRs in this repo
$ gh issue list --assignee "@me"My issues
Just open it in the browser#
When: Some things are easier on the website: big diffs, screenshots, settings.
Type this and press Enter.
Commands to copy
$ gh browseRepo home page
$ gh browse 123PR or issue by number
$ gh browse src/api/auth.tsA file
$ gh pr view --webMy current branch's PR
Run a deploy workflow manually#
When: Your team has a GitHub Action you start by hand, like Deploy or Seed DB. On GitHub it shows a "Run workflow" button.
Type this and press Enter.
Commands to copy
$ gh workflow run deploy.yml --ref develop -f environment=stagingRun from the develop branch with an input
$ gh run watchFollow it live
$ gh run list --workflow=deploy.ymlPast runs
Your whole toolbox
Every situation in this track, searchable
20 of 20 situations
Setting up
Open the lessonFirst day: set up gh on my laptop
$ winget install --id GitHub.cliI have a work account and a personal account
$ gh auth status
Starting work
Open the lessonGet the team's repo on my laptop
$ gh repo list your-orgI was assigned an issue. Where do I start?
$ gh issue list --assignee "@me"
Before the PR
Open the lessonWhat changed between my branch and develop?
$ git fetch origin
Opening a PR
Open the lessonOpen a PR for my work
$ gh pr createMy PR must go into develop, not main
$ gh pr create --base developOops, I opened the PR against the wrong branch
$ gh pr edit 123 --base developMy work isn't finished, but I want early feedback
$ gh pr create --draft --base developMy new work depends on a PR that isn't merged yet
$ gh pr create --base feat/login-apiAdd reviewers or labels to my PR
$ gh pr edit 123 --add-reviewer alice,bob --add-label frontend
After the PR is open
Open the lessonCI failed on my PR
$ gh pr checksMy PR is out of date with develop
$ gh pr update-branch 123A reviewer asked for changes
$ gh pr view 123 --commentsMerge my PR
$ gh pr merge 123 --squash --delete-branch
Reviewing others
Open the lessonA teammate asked me to review their PR
$ gh pr list --search "review-requested:@me"
Everyday extras
Open the lessonI found a bug but can't fix it right now
$ gh issue createWhat's waiting for me today?
$ gh statusJust open it in the browser
$ gh browseRun a deploy workflow manually
$ gh workflow run deploy.yml --ref develop -f environment=staging
Where this track leaves you#
You can now go from day one to a merged PR: set up gh, start fresh branches, check what you're sending, open PRs into the right place, handle CI and reviews, review others safely, and keep up with your day. Bookmark this lesson: the search box above is the whole playbook in one place, filled in with your setup.
Check yourself