Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How GitHub forms a pull request

I have a branch which has merged master to it couple of times (to get the newest bug fixes to that feature branch). Now I wanted to see all the changes I have made after I started working in that branch so I tried git diff start_commit..HEAD. However I noticed that git also displayed those merged commits so that was not what I wanted.

Then I tried to create a pull request from that branch to see if same applies to GitHub's pull request, but noticed that pull request was only displaying my changes which was what I wanted.

Branches looks like this

master: A---B---C---D---E---F
         \       \       \
feature:  G---H---I---J---K---L

And the problem is that git diff A..L is displaying all commits from A-L, but GitHub's pull request is only displaying G-L which is what I want.

So what command (or commands) GitHub is using to form a pull request?

Edit: Added a picture

like image 615
OsQu Avatar asked Oct 06 '22 12:10

OsQu


1 Answers

Check this out. From git documentation:

Comparing branches

    $ git diff topic master    <1>
    $ git diff topic..master   <2>
    $ git diff topic...master  <3>

1. Changes between the tips of the topic and the master branches.

2. Same as above.

3. Changes that occurred on the master branch since when the topic branch was started off it.
like image 57
GautamJeyaraman Avatar answered Oct 10 '22 03:10

GautamJeyaraman