Tips and tricks practical Git

Table of contents

No heading

No headings in the article.

  1. Merge multi commits of a branch into one commit

    Sometimes, when you want to have a nice view of commits of 1 branch, and you want to merge multi commits into one commit:

    • Ideal: Soft reset to a commit —> commit —> and force push to the server.

    • Steps:

        git reset --soft [commit hash] 
        git commit [...]
        git push --force origin [branch name]