Skip to content

Instantly share code, notes, and snippets.

@Adrian0350
Last active April 25, 2018 22:58
Show Gist options
  • Save Adrian0350/626ce930261bde275924078968ddcb5e to your computer and use it in GitHub Desktop.
Save Adrian0350/626ce930261bde275924078968ddcb5e to your computer and use it in GitHub Desktop.
A collection of instructions to handle git actions.

GIT Helpers

Changing a commit's message

$ git rebase -i HEAD~n

This will prompt a vi console with options.

The n parameter indicates the commit quantity to edit in {creation time} ascending order. Say you run $ git rebase -i HEAD~2; this will select the last two commits.

After this you will want to type i to enter insert mode in vi console and ESC to exit insert mode.

Find the commit to edit its message and replace pick for r (option description will be displayed in console).

Press : and write wq (write & quit) to save changes.

Edit your commit message, save changes and exit :wq.

Push changes $ git push -f.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment