Dealing with declined / rejected pull requests

11,530

What do I do to update a Pull Request? Just push a fix commit on top?

On GitHub, yes, you can add new commits, or even reorder/modify the existing commit of your dedicated branch, force push that branch to your fork (git push --force) and the existing pull request will get updated, any Travis CI job will run again, and the original repo maintainer will be notified.

But even on BitBucket, pull requests are for commits proposed from a fork, not from a branch from the same repo. See "Fork a Repo, Compare Code, and Create a Pull Request"

The pro is mainly for preventing contributors to modify a repo, and force them to work in their own repo (the fork, that they then clone on their local computer).

Share:
11,530
Ben Barbour
Author by

Ben Barbour

Updated on June 11, 2022

Comments

  • Ben Barbour
    Ben Barbour almost 2 years

    So, I'm quite fluent with git in general but I've only never used branch based workflows, and mostly with Gerrit. I'm pretty much new to Pull Requests.

    Pull Requests mostly resemble to me as a branch pushed to Gerrit, awaiting review. In Gerrit, if there's a problem with one of my commits, comments are left on it and it receives a non-positive score. With a Pull Request comments can be left on it and it can be declined. In Gerrit, to address the issues the comments raised I amend the offending commit(s) and push them up again (well, new commits with the same Change-Id). What do I do to update a Pull Request? Just push a fix commit on top? Cancel the pull request (is this possible?), amend my commits and push up a new one?

    We're using Bitbucket for our project and right now we're planning on avoiding forks and just making the pull request to master (our "production" branch) from feature branches, mostly because that feels closer to what I'm familiar with.