Useful snippets

    compare branch with main

    CLI

    git show $(git branch --show-current)

    git diff main..$(git branch --show-current)

    git branch --show-current is current branch

    Lazygit

    1. Highlight main branch
    2. Shift w & hit enter
    3. highlight the branch you want to compare with

    Webstorm

    1. GitToolBox? Should not be necessary I think

    https://useful-snippets.netlify.app/posts/webstorm-compare-with-branch/

    image

    VS Code

    1. Gitlens?

    Neovim

    1. Diffview