1

I forked a github repo and would like to update an open pull request on the main repository. Before doing that however I want to do a dry run on my local box to make sure things will go smoothly when someone builds this project after the pull request is merged.

I'm not sure how to test this scenario however? I'm debating whether I should create a new branch on my forked repo, stage my changes and push to it.

From there, if I go to my local copy of the original repo and pull from my forked repository/new branch and try building, that should cover me?

If so, my question is how do I then update my original pull request with the changes I pushed to my forked repo's new branch? I've already staged and pushed them to the new branch, is there a way to 're-push' them to my original branch, so the pull request is updated?

Maybe I'm way off and there's a better approach to all this, in which case I'm all ears. Thank you.

jkj2000
  • 1,423
  • 3
  • 17
  • 25

1 Answers1

1

I'm debating whether I should create a new branch on my forked repo, stage my changes and push to it.

That is the generally accepted best practice: isolate your change in a branch that you:

Community
  • 1
  • 1
VonC
  • 1,042,979
  • 435
  • 3,649
  • 4,283
  • thanks. So a possible strategy would be to close the original pull request, and make a new one based on the new branch? Can-do, just making sure that doesn't violate some sort of git-etiquette. – jkj2000 Oct 30 '14 at 20:56
  • 1
    @jkj2000 yes, you can do that. The idea behind a branch is that you can push it as many time as you want, while updating the branches of your repo with the ones of the original repo. – VonC Oct 30 '14 at 21:10
  • VonC-- thanks again. I got what I needed done. One question however? On my forked repo I merged my new branch to the original one, and the pull request based from that branch on the main repo was updated automatically. If I wanted some time to examine things a bit before updating the PR, should I close the PR and then open a new one based on the same branch? – jkj2000 Oct 31 '14 at 00:48
  • 1
    @jkj2000 yes, that would help isolate that the new PR. It is best to create a new branch branch an official one (master or another branch common with the original repo), in order to facilitate subsequent rebase. – VonC Oct 31 '14 at 06:27