GitHub Topics (7)Tap to view
    GitHub·Version Control·Topic 3 of 7

    GitHub Pull Requests

    Pull Request (PR) lifecycle, staging and pushing, pre-merge screening, and creating and merging PRs via the GitHub CLI.

    1. Pull Request Workflow & Review

    1. git switch -c feature/x

      What it doesCreates a new working branch for a feature or fix and jumps to it directly

      When to use itBefore starting to write any new code for the pull request

      Examplegit switch -c feature/health-check

    2. git diff --check

      What it doesChecks edits and detects unwanted end spaces and formatting problems

      When to use itbefore adding files to the commit to keep the PR clean

      Examplegit diff --check

    3. git push -u origin feature/x

      What it doesUploads the local feature branch to the remote repository and sets the trace

      When to use itWhen ready to open a new withdrawal request

      Examplegit push -u origin feature/health-check

    4. gh pr create --draft

      What it doesCreates a draft PR to indicate work is continuing

      When to use itTo get early feedback from the team or run CI checks without requiring a final review

      Examplegh pr create --draft --title "WIP: Health check endpoint"

    5. gh pr view

      What it doesDisplays the details of the current withdrawal request or its number specified in the terminal

      When to use itTo know the status of PR, reviewers and comments without leaving the terminal

      Examplegh pr view

    6. gh pr diff

      What it doesDisplays the full programming differences for the current withdrawal request

      When to use itto review the submitted changes and compare them to the target branch

      Examplegh pr diff

    7. gh pr checks

      What it doesDisplays the results of CI/CD checks and GitHub Actions workflow for the current PR

      When to use itto ensure the success of all automated tests and checks before merging

      Examplegh pr checks

    8. gh pr merge --squash

      What it doesSquash merge the pull request into one structured commit

      When to use itto keep the master branch sequence and history clean

      Examplegh pr merge --squash --delete-branch

    Offline · Reading cached copy