Pre-push git hook not executing via SourceTree

Hi,

I have an issue where I have a pre-push git hook, but it is not executing when pushing via SourceTree. If I push via the command line, it executes fine, and that is copying the exact git command that SourceTree is trying to execute.

I have a pre-commit hook which executes correctly from both the command line and SourceTree, so just not sure why SourceTree and my pre-push hook are not playing nice together.

I have dumbed all hooks down to a simple echo statement to ensure there is nothing wrong with the way the hooks were written, and the outcome of each combination is still the same i.e. all hooks execute except for pre-push when using SourceTree.

Any help would be appreciated, thanks.

3 answers

It is worse. I just confirmed some information found at http://stackoverflow.com/questions/17538460/using-git-pre-commit-hooks-in-context-of-github-client/33588294#33588294 that indicates, that executing source tree from the command line (likes so: open /Applications/SourceTree.app/Contents/MacOS/SourceTree) results in the hooks working. 

I am using it and its working quite well for me

I also had this error, and applied Jürgen Simon's fix. It works great for me, so long as I remember to open the app from the command line.

Recommend adding an alias to your .bash_profile:

    alias "ost"="open /Applications/SourceTree.app/Contents/MacOS/SourceTree"

or if your SourceTree is installed off your Users/[self]/Applications folder:

    alias "ost"="open ~/Applications/SourceTree.app/Contents/MacOS/SourceTree"

This fix works for me (sort of) but shows me a warning on launch. Still launches though. 

Thanks Jürgen Simon!

Here is the warning:

2018-02-09 11:50:36.792 Sourcetree[48868:2392163] [Crashlytics] Version 3.9.3 (128)

2018-02-09 11:50:36.976 Sourcetree[48868:2392163] NSWindow warning: adding an unknown subview: <INMovableByBackgroundContainerView: 0x7f9215adeb20>. Break on NSLog to debug.

I also hereby confirm this bug is alive and kicking in Version 2.1 (2.1)

i still see this on 2.6.3 (134). however, it's happening with a pre-commit hook for me

Suggest an answer

Log in or Join to answer
Community showcase
Brian Ganninger
Published Jan 23, 2018 in Sourcetree

Tip from the team: workflow and keyboard shortcuts

Supported Platforms macOS Sourcetree has a lot to offer and, like many developer tools, finding and using it all can be a challenge, especially for a new user. Everyone might not love ...

274 views 0 3
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot