git cherry-pick -n <commit>

The "-n" is alias for "--no-commit" and it applies the content of the target commit into your working directory without making any commit. Usefull if you want to cherry-pick many commits, tweak them and make a new one or simply want to grab some functionality into your index.

What's yours well-appreciated but not-that-well-known git functionality?

  • 0
    git commit-tree

    It allows you to create an orphan tree of commits by specifying a parent flag. These commits can then be reliably merged to another repo or branch as a single unit. This is useful for public-private release strategies.
  • 1
    git rebase -i

    Every rebase is a lie, but sometimes it's worth it.
  • 0
    History rewriting is a real life saver when you have to get rid of something and need to make sure, that it does not resurface ever again.
    Don't forget to also command everyone to re-clone afterwards...
Add Comment