Skip to main content

Command Palette

Search for a command to run...

Tips and tricks practical Git

Updated
•1 min read•View as Markdown
K

I am a Software Engineer from Ewoosoft Vietnam. Domain: Healthcare programming

  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]