First of all, yes, I have read all topics here related to my question. But other questions are based on changes made locally and using command line.

I'm asking about this specific situation: working on a Win-PC and making changes in several files directly in GitHub (not local!).

I am creating new files in my own repo (because I don't have write/commit access to the original branch).

Now I want to create PRs to push them into the original repo. Currently I see no way to merge all into one PR; instead I have to create a separate PR for each changed file.

Does someone here know how to create one instead of multiple PRs? I did not find a way when working directly on Github.

3 Replies 3

You can make use of git rebase command. You can follow the below steps:

1. git commit -m "First file"
2. git commit -m "Second file"
3. git commit -m "Third file"

Now you have committed all your changes, if you have run below command , you will see the commit IDs

4. git log

Now you can run the git rebase command

5. git rebase -i HEAD~3

6. You can use squash (s) option to meld commits of yours into single commit in this First commit (created in step 1) .


  commitID 1
s commitID 2
s commitID 3

7. Save the changes and re-save the changes. And you are done , where you will have all the other commits meld into single commit and raise a PR , in which you will have single PR.

The easiest way is to make each change as a different commit to the same branch, and then merge with the "squash" option

- Edit a file from master, and press Commit changes
- Choose "Create a new branch for this commit and start a pull request"
- Create the pull request
- Click your new branch name (<user>-patch-X) to access the file tree there. You can find this where it says username wants to merge 1 commit into main from user-patch-2
- Create a new edit
- Commit the changes, and choose "Commit directly to the user-patch-2 branch"
- When merging your PR, click the arrow in the "Merge pull request" button and choose "Squash and merge"

Thanks for your comments and help. But that does not answer my question .. I asked how can this be done via the current GH GUI, and not with any command line commands.

Here is the correct way (I made by myself just a minute ago) via the GH UI only:

  1. Either fork the desired repository or branch in desired repository OR if you already forked that in the past > update it if it's behind the original

  2. Create/edit file(s) now in your own branch to make changes

  3. Go to the overview and select the target branch you made the the commits before

  4. Click on the line saying "This branch is x commits ahead of xxxxx"

  5. Click on the green button saying "View pull request"

  6. The new PR with all changes will then be created in the target repository

Just one note: do not delete at GH your files until they are merged!

While if you have made the whole work on your PC and submitted everything to GH, deleting those files locally is allowed and has o effect to and in GitHub.

Your Reply

By clicking “Post Your Reply”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.