gitgithub

Is it important to open a pull request after just pushing changes with new branch?


Every time I push my changes on GitHub, I always see a popup with a "compare & pull request" notification on top of my repo.

So is it important to open a pull request on every change?


Solution

  • It is just a message to inform you:

    But you remain in charge, and decide when what you have pushed should be considered for a PR or not.

    And you don't have to go to GitHub for that: if you install the GitHub CLI, you can open a PR directly from your console, with gh pr create.

    When the current branch isn't fully pushed to a git remote, a prompt will ask where to push the branch and offer an option to fork the base repository. Use --head to explicitly skip any forking or pushing behavior.

    A prompt will also ask for the title and the body of the pull request.
    Use --title and --body to skip this, or use --fill to autofill these values from Git commits.


    Q3 2025: PR 11300 from gh v2.75.1 points out to issue 10527.

    With gh pr create --fill --title "test" --body "ticket number" the title and body options take precedence and overwrite any autofilled content.

    However, this does not seem to be the case when using the --web flag as well: gh pr create --fill --title "test" --body "ticket number" --web: this does not prioritise the title and body options.

    That was fixed once, but... issue 11277 (gh pr create --web now always overwrites autofilled content).