DEV Community

pmgzo
pmgzo

Posted on • Edited on

My last git command that I learned to use

My last command that i learn is git cherry pick <hash of the commit to use>

Basically "cherry pick" help you to add a commit from another branch to your current branch.

Say you coded a piece of code that you need right now in your current branch, you can use git cherry pick.

Just make sure that both branches (one with commit to add and your current branch) have a common root history. However they don't need to have exactly the same history.

Top comments (0)

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay