Reputation: 99536
In GitHub, after I create a pull request to merge a number of commits into master from the feature branch, I click the pull request, and saw:
Tim wants to merge 3 commits into master from feature
Below it , there are three tags:
"Conversation 0" "Commits 3" "Files changed 33"
when I click "Files changed 33", I guess that it will show the output of git diff
between a commit on the feature branch and a commit on the master branch.
My questions are:
which commit on the feature branch? The latest commit on the feature branch? So if I further push a new commit on the feature branch to GitHub, will the results shown on "Files changed 33" be updated?
which commit on the master branch: the master branch's commit at which the feature branch was forked, or to the latest commit on the master branch?
Thanks.
Upvotes: 0
Views: 808
Reputation: 17506
The commits on your pull request are compared to the latest commit on the master
branch. It wouldn't make much sense to compare them to the point at which the repo was forked, because many changes may have happened in between that may be in conflict with your changes. And if you tried to merge your changes without being aware of these conflicts bad things could happen :)
Actually, if you look closely, GitHub does something interesting. When you're looking at the "files changed" tab of your pull request, and someone happens to push a commit to master
, you'll see a small warning on the page saying that "the page is out of date", and if you refresh it you'll see the new diff. GitHub automatically calculates the "files changed" every time someone pushes code into master
.
Upvotes: 1