Github suggested pull-request with not file changes

Started seeing this behavior recently. I compared a project repository with my forked repository and created a Pull Request and merged the changed to my fork.

Now Github is suggesting that my fork is ahead of the project repository by 1 commit and suggesting to create a pull request.

This is correct if we consider commit numbers as a means of calculating which branch is ahead, which does not make sense as the files are exactly same version. The pull request i try to create from this option shows no files.

This behavior is same even if I try to rebase instead of merge.

Am I missing something here?

This behavior is correct: Your fork has commits that are not in the upstream repository. In case of a merge commit that, in case of a rebase merge all the commits (because rebase recreates them, which leads to different commit hashes).

I’m not aware of any way to keep a fork up to date using Github tools, generally the procedure is:

  1. Add the upstream repository as a remote to your local repository (git remote add).
  2. Fetch from upstream and fast-forward merge (or check out) to a suitable branch.
  3. Push that branch to your fork, under whatever name you want the upstream code.
1 Like

Thank you airtower-luna for the reply. I did the same procedure that you suggested, and github UI suggested a pull request to be created to the parent repo.

I agree to the behavior, but my question more towards why does github suggest a pull request when there are no files to be merged. Is this something that got newly introduced as i dont remember seeing this before in github (or may i just noticed it recently).