MacOS – How to change Sourcetree icon shown in Dock

dockiconmacos

I have an app that is very useful, but from time to time it changes its icon in the Dock, which I found disturbing for my workflow.

I would like to prevent that as I am perfectly satisfied with the standard icon.

I've tried following the instructions in the article, How to change Mac app icons but as soon as the app starts, it changes the icon back.

I've also poked around Contents/Resources directory in the app bundle, but could not find the said icon.

Does anyone have a workaround?

Best Answer

Here's a oneliner solution.

Open terminal and type:

perl -i -p -e 's/Pridetree/Bridetree/;' /Applications/Sourcetree.app/Contents/Resources/Assets.car

Restart Sourcetree. App icon will be restored to the default one.