Skip to content

Instantly share code, notes, and snippets.

@JesusLeon
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JesusLeon/c1816f29a3a5fa916954 to your computer and use it in GitHub Desktop.
Save JesusLeon/c1816f29a3a5fa916954 to your computer and use it in GitHub Desktop.
Git solutions
git cherry-pick -n <commit> # get your patch, but don't commit (-n = --no-commit)
git reset # unstage the changes from the cherry-picked commit
git add -p # make all your choices (add the changes you do want)
git commit # make the commit!
# Use git rebase to set HEAD on commit bbc643cd
$ git rebase --interactive bbc643cd^
# In the default editor, modify 'pick' to 'edit' in the line whose commit you want to modify.
# Make your changes and then stage them with
$ git add <filepattern>
# Now you can run to modify the commit
$ git commit --amend
# and after that to return back to the previous head commit.
$ git rebase --continue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment