Skip to content

Instantly share code, notes, and snippets.

@HallexCosta
Last active April 25, 2021 21:54
Show Gist options
  • Save HallexCosta/c7355aca57d3bf4326cfe5d042fc4b2c to your computer and use it in GitHub Desktop.
Save HallexCosta/c7355aca57d3bf4326cfe5d042fc4b2c to your computer and use it in GitHub Desktop.
Example of how to move commit "on top"

Move commit "on top"

# main:    A--B--X--Y
# feature: A--B--$--C--D

# new feature: A--B--C--D--$

# example to use command:
# git rebase -i {commitHash}~{moveToPosition}
# git rebase -i $~1

# real world example
$ git rebase -i 74208a9d8611c6c11e06b624276cc96f931818b4~1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment