Search code examples
gitgithubgit-commit

Can I edit two files then make one commit using GitHub Web-based editor?


GitHub has the nice feature of Web-based 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 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 web-based workaround:

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

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