gitgithubgit-commit

Can I edit two files and then make one commit using the GitHub webbased editor?


GitHub has the nice feature of webbased file editing. However, it seems that, after editing one file, I have to commit the changes for this file before continuing. Is there a way I can edit two or more files, and then make one commit for all the changes of them?

I think this would be better, since too many unnecessary commits are annoying.


Solution

  • There is a webbased workaround:

    1. Create a temporary branch, and switch to it;
    2. Edit multiple files, and commit each file separately;
    3. Make a pull request;
    4. Under the Merge pull request button, choose Squash and merge (if the repository allows it), and then confirm merge;
    5. Delete the temporary branch.

    I use this method on a PC which I don't want to install Git on.