Apple - How do I change Sourcetree icon shown in Dock?

If anyone is interested, the issue was Pride icon on SourceTree app. I've found the solution here:

  1. Go to
  2. Switch to releases tab (I took the latest pre-release)
  3. Download .zip and extract it
  4. Open the with right click - show package contents and navigate to Contents/Resources
  5. Copy and sourcetree.icns to any folder
  6. Run ThemeEngine from the zip in step 3
  7. In ThemeEngine click "Open Document" and open the
  8. Find the icon named Pridetree
  9. Open sourctree.icns with your preferred app - I used preview. Clicked on second icon pressed cmd + a to select whole image and pressed cmd + c to copy it.
  10. Clicked on first image in Pridetree ThemeEngine and pressed cmd + v to paste it.
  11. Repeat with second image.
  12. Save the document
  13. Replace in the app Contents/Resources with modified

Do not forget to backup your files. Your are doing this on your own risk as I do not know if it actually breaks the EULA.

Here's a oneliner solution.

Open terminal and type:

perl -i -p -e 's/Pridetree/Bridetree/;' /Applications/

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