Skip to content

Maintenance: PR Clean Up

Anthony Nandaa edited this page Jul 2, 2019 · 8 revisions

Guide for Cleaning up a PR

We have situation where someone opens a PR and they are not able to do some clean-ups before it's landed.

Steps:

  • Make sure your local master is up to date with the origin/master, origin being validatorjs/validator.js
  • Create a remote pointing to the repo where the PR originated from, e.g. for the case of PR#923:
    $ git remote add other git@github.com:odrzutowiec/validator.js.git
    
    update-pr-1
  • Checkout a new branch off master, can name it chore-clean-#<pr-id>
  • Fetch the work from the remote branch (will not always be master, depends on what the author called it), e.g.
     $ git fetch other master
    
  • Merge the fetched branch and fix merge conflicts if any (NB: using -X ours, then add back their work manually, e.g.
    $ git merge other/master
    
  • Make all the necessary changes, run tests and commit the work.
  • In your commit body, remember to add:
    Co-authored-by: name <name@example.com>
    
    closes #<pr-id> #<original-issue-id-if-any>
    
  • Push the new work to your remote (the fork on your GH profile), eg.
    $ git push prof chore-clean-#923
    
  • Go to GH and create a new PR, linking it up with the old PR.
Clone this wiki locally