Let's say that a contributor on a project submits a pull request and I need to compile the code in order to make sure that it fixes the issue. In this scenario, I usually copy the changes that the author made into my local repo, run everything and make sure it works, merge the PR, and run git pull
to update my local repo.
But I just discovered that PR's result in a new branch. So I guess it would be better to run git pull
and git checkout <branch>
locally, run the code and make sure it fixes the issue, then merge the PR and delete the branch.
What about the scenario in which a (non-contributor) forks a repo, makes changes to the main branch of his forked repo, sets the upstream to the original repo, and submits a PR? Does this result in a new branch on the original repo that I can checkout locally in order to test out the proposed changes?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…