Skip to content

Instantly share code, notes, and snippets.

@luckman212
Created December 8, 2021 19:11
Show Gist options
  • Select an option

  • Save luckman212/a906cc34ad996efa8d723f6081094023 to your computer and use it in GitHub Desktop.

Select an option

Save luckman212/a906cc34ad996efa8d723f6081094023 to your computer and use it in GitHub Desktop.
rendering bug

git rebase method

  1. Note the commit hash of your current state

    $ git log -1 --oneline
    5b0ab1a (HEAD -> add-regex-matching, origin/add-regex-matching) don't strip .md from filepath
  2. Squash (merge) the last 2 commits

    git rebase -i HEAD~2
  3. Change newer commits (rows 2->n) to squash or fixup (discards commit message). Example:

    pick 0abcdef this is the "main" commit
    fixup 1fedcba this will be squashed
    fixup 2cdef0a this will also be squashed
    
  4. Push (--force) is probably needed

    git push origin <branch_name> --force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment