user2924482
user2924482

Reputation: 9140

Updating pull request after review changes commit doesn't show up in the pull request

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.

Upvotes: 64

Views: 80262

Answers (9)

Syed Aman Ali
Syed Aman Ali

Reputation: 208

Close the PR and reopen it again. This worked for me.

Upvotes: 0

Raj Shukla
Raj Shukla

Reputation: 498

This is what fixed the issue for me, I selected a random branch.

  • Click on Edit in the top right corner.
  • Click on the base selector and choose a random branch. [ Any branch other than the current base branch ]
  • GitHub will ask you whether you want to change base, confirm.
  • Later, change the base again to master. The PR should update and the commit should show up.

Upvotes: 3

Deniz Utku
Deniz Utku

Reputation: 21

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

git commit --allow-empty -m "x"
git push

Upvotes: 2

Masih Ansari
Masih Ansari

Reputation: 41

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

Upvotes: 4

VonC
VonC

Reputation: 1329112

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.

Upvotes: 33

Kangaroos In Antarctica
Kangaroos In Antarctica

Reputation: 1349

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.

Upvotes: 125

Mom Mam
Mom Mam

Reputation: 121

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

Upvotes: 3

Aakarshit
Aakarshit

Reputation: 65

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.

Upvotes: -1

Aayush Grover
Aayush Grover

Reputation: 53

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

Upvotes: 5

Related Questions