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

shengbinmeng picture shengbinmeng · Jul 23, 2013 · Viewed 17.8k times · Source

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.

Answer

Victor Istomin picture Victor Istomin · Sep 26, 2014

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.