I committed and pushed some files via git commit . followed by git push.
Then, I found that there were some mistakes in the files. I fixed ti. Then, I recommitted and re-pushed. So, I now see two separate commits in git log, which is ugly.
Can I merge these two pushed commits into one?
git commit --amend, which amends the previous commit. Then push withgit push --forcewhich will overwrite the previous commit. @AdamT's advice on shared repositories still holds.