41

I forked a GitHub repository and made some changes on my fork and submited a pull request but the owners of the original GitHub repository asked for some changes which they asked me for in the pull request. I assumed that adding additional changes to my fork will cause them to show up in the current pull request but to my surprise I can't see my changes in the pull request.

This is what I did after generating the original pull request:

  1. made code changes
  2. add the files 1git add -A`
  3. commit the files git commit -m "these are my suggested changes in pull request"
  4. submit my changes with git push

I can see changes on my own fork but I don't understand why I can't see any changes in the pull request.

Does anyone know what I need to do for my changes to show up in the current pull request?

I'd really appreciate your help.

Matthias Braun
  • 32,039
  • 22
  • 142
  • 171
user2924482
  • 8,380
  • 23
  • 89
  • 173
  • Does this answer your question? [GitHub pull request showing commits that are already in target branch](https://stackoverflow.com/questions/16306012/github-pull-request-showing-commits-that-are-already-in-target-branch) – Michael Freidgeim Aug 26 '20 at 10:42

8 Answers8

79

First, make sure that you did push to the right branch and that the commit still doesn't show up in the PR. For me, the commit showed up when I viewed the specific branch in the repo, but didn't show in the PR and didn't trigger CI.

This is what fixed the issue for me:

  • Click on Edit in the top right corner.
  • Click on the base selector and choose the same base branch.
  • GitHub will ask you whether you want to change base, confirm.
  • The PR should update and the commit should show up.
22

2023: as noted in KangaroosInAntarctica Yes's answer, you have a specific workaround for a potential issue where commits may not appear in a pull request even though they've been pushed to the correct branch.

By editing the base selector and choose the same base branch.

Note however that there is a GitHub incident with Pull Requests in progress (July 5th, 2023):

We have identified an issue that caused pull requests to not reflect additional git pushes over the last several hours. New pushes will now be processed as normal.

So that workaround might not be needed much longer.


2017: You need to be sure to be in the same branch as the one you used for your pull request.

As mentioned here

The pull request will automatically add the new commits at the bottom of the pull request discussion (ie, it's already there, scroll down!)

If the pull request is still open, you should see your new commit there.
If not, contact GitHub support: there might be some synchronization issue.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
5

Add new commit with any dumy change which you can revert later on( or add a new commit by adding comment on any function to explain its working which needs not to be reverted) this will refresh your PR

Aayush Grover
  • 53
  • 1
  • 4
  • My PR was stuck not showing all commits I pushed and simply pushing a new commit helped refreshing the PR on github, thanks! – Snow bunting Apr 18 '23 at 10:54
  • Exactly what was needed! But I'm left wondering why the PR didn't refresh without having to add on an empty commit to the chain? Hopefully someone can shed some light here. – changingrainbows May 04 '23 at 16:25
  • 4
    Closing the PR and then immediately re-opening it also worked for me. – Robert Hardy Jun 07 '23 at 18:17
3

I had similar problem, did commits and comments, nothing happened. So i gave up and after 40 min the PR updated automatically.

Mom Mam
  • 91
  • 6
3

It look like a synchronization issue. click on edit and change the base branch to same ( if you are merging your branch with main select main ). it will show a pop up that all the some commit from old branch may remove and it update the PR from you updated branch to main.

Step 1: enter image description here

Step 2: enter image description here

select the same branch it will update the PR. it throw pop up for change the base. then save, it will update your PR

DonMiguelSanchez
  • 376
  • 3
  • 15
1

Had the same issue, fixed by pushing an empty commit.

git commit --allow-empty -m "x"
git push
Deniz Utku
  • 11
  • 1
0

Annnd it's back again. I've definitely pushed to the correct branch and can see the commit on Github when I visit

https://github.com/team/repo/**compare**/branch-name

But not when I look at the PR itself.

Graeme Blackwood
  • 2,416
  • 1
  • 13
  • 5
-1

If you have raised a branch from Source A to Destination B then try to edit the PR and update the PR with the same Source(A) and same Destination(B). This will work and the new changes will be visible.

Aakarshit
  • 49
  • 6