Git Cherry Pick With X Option In Sourcetree

There were a series of changes to the staging branch that I needed to bring over to the development branch today. After a bit of research online, I wanted to use the -x option of the cherry-pick command. This would put a reference to the original commit-ish in the new commit message for me which can be very helpful for keeping track of where everything comes from.

Since Sourcetree only does a basic git cherry-pick <commit> when you use the “Cherry Pick” command, I decided to create a custom action.

Cherry Pick W X Option Custom Action

Custom Action for “git cherry-pick -x “

Now all I need to do is right click the commit I want to cherry pick and choose Custom Actions > Cherry Pick w/ -x and the original commit-ish is referenced automatically in the commit message.

Improved_CP_Commit_Message

Reference to the original commit automatically included in the commit message

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s