Skip to content

Instantly share code, notes, and snippets.

@j16h
Last active July 17, 2017 15:42
Show Gist options
  • Save j16h/0d7afaa6b71156e1c04df0a1d22f1d87 to your computer and use it in GitHub Desktop.
Save j16h/0d7afaa6b71156e1c04df0a1d22f1d87 to your computer and use it in GitHub Desktop.
Git commands to survive

Git commands to survive

@j16h
Copy link
Author

j16h commented Jul 17, 2017

Change pushed commits:

  1. git rebase -i Head~2 // last 2 commits

  2. If you want to edit comment message:

    Change: pick 07bfb7d my comment

    To: r 07bfb7d 948 my comment

  3. Save changes :wq.

  4. Start editing comment by pressing i. When finished editing press ESC and then :wq

  5. Repeat step 4 for as many comments as you specified in Head~2, in this example 2 times

  6. When ready: git push --force

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