Skip to content
jsworkbench.
Learning path
Intermediate18 min

Issues and pull requests

Understand the idea

An issue is a written problem. A pull request is a proposed diff plus the conversation about it.

The idea

An issue is stored on the , not in the terminal scrollback. A names a source branch, a target branch, and a title. Opening it does not merge. The diff is the commits on the source that the target does not yet have. The conversation, including reviews, hangs on that request.

What changes

git issue new "Empty login fails" inserts a numbered issue row. git pr new topic main "Handle empty login" inserts a pull request whose review comments start empty. The branch labels do not move. The graph is unchanged until someone merges.

Issue and pull request
ObjectWhat it storesWhat it does not do
IssueA title, a body, and an open statusChange files
Pull requestSource, target, title, and commentsMerge by itself
Merge commitTwo parents and a snapshotHold the review conversation

The command

On your repository, run git issue new "Empty login fails". Then commit on a branch and run git pr new topic main "Handle empty login". Both rows belong to this repository. The next lesson writes a review onto that request.

The mistake

Check your graph

The graph should look the same as before the issue and the pull request. What changed is the repository's issue list and the open request from topic into main.

Your repository

Open an issue and a pull request on your repository. They stay in this platform's tables.

  1. Step 1

    Branch for the fix

    The pull request will propose this branch. If it already exists, run git switch fix-empty-login.

  2. Step 2

    Describe the fix in a file

    Create login.txt in the editor and set the text to: Reject an empty login

  3. Step 3

    Stage the fix

    The pull request will show this commit’s diff.

  4. Step 4

    Commit the fix

    fix-empty-login now has a commit main does not have.

  5. Step 5

    Open the issue

    The issue is a written problem on this repository. The branch does not move.

  6. Step 6

    Open the pull request

    This proposes fix-empty-login into main. It does not merge.

The editor edits the working tree. Start a repository and the files appear here.

Follow the steps. Each command step can be placed in the terminal. Edit files in the editor, then stage them.
Supported command reference
  • init
  • add <path> | add .
  • commit -m "message" | commit --amend -m "message"
  • status
  • diff | diff --staged
  • log | log --oneline | log --graph | log --oneline --graph
  • show [ref]
  • branch | branch <name> | branch -d <name>
  • checkout <ref> | checkout -b <name> | switch <name> | switch -c <name>
  • merge <branch>
  • rebase <branch> | rebase -i <branch> | rebase --edit-todo <pick|drop|reword> <hash> [message] | rebase --continue | rebase --abort
  • cherry-pick <ref>
  • reset --soft <ref> | reset --mixed <ref> | reset --hard <ref>
  • revert <ref>
  • stash | stash list | stash pop | stash apply
  • restore <path> | restore --staged <path>
  • remote | remote add <name> <repo-slug>
  • clone <repo-slug> | git clone <repo-slug> | git fork <repo-slug>
  • fetch [remote] | pull [remote] [branch] | push [remote] [branch] | push --force [remote] [branch]
  • blame <path>
  • reflog
  • tag | tag <name> [ref] | tag -d <name>
  • bisect start | bisect good [ref] | bisect bad [ref] | bisect reset
  • config <key> <value> | config --list
  • write <path> <text> (workbench: edit the working tree)
  • issue new "title" | pr new <source> <target> "title" | review "comment" | review --request-changes "comment"

Commit graph

No commits yet. git init creates the first one.

Quiz

A quick check for understanding. Retry as often as you like; your learning path stays open.

01What is a pull request?
02Where is an issue stored?

Ready to call this one understood?

Mark this lesson complete to earn 150 XP. You can always revisit it.

Sign in to save progress
Next lesson