Tim
Tim

Reputation: 99536

What does ""Files Changed" mean in a pull request webpage?

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:

Thanks.

Upvotes: 0

Views: 808

Answers (1)

Maria Ines Parnisari
Maria Ines Parnisari

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

Related Questions