Does SourceTree have an interface for git-hooks?

Not much else to be said. We'd like to work with git-hooks without having to use the command line.

1 answer

1 accepted

2 votes
Accepted answer

There is no option for this in SourceTree. Just copy the hooks into the /.git/hooks/ folder of your clone.

I'm accepting this answer, although I'm also putting in a suggestion for SourceTree.

Like 2 people like this

SourceTree Mac 2.7.6 here: `/.git/hooks/` is not working anymore.

Just in case, Chris: Are you sure you set the hook script(s) to executable (chmod +x)? I just got here via google because I forgot to do exactly that.

git throws a warning (at least 2.17.1 does) on the console if it sees a script but it isn't set to x, but unless you have the "Command History" shown in SourceTree you won't see that. Was scratching my head for a bit why my very simple pre-commit wasn't called.

@Gero Herkenrath Yup, tried making the hook script executable 👍

Using GIT version: 2.17.1

Oh my.
@Gero Herkenrath I had run chmod +x on the hook file but just now also tried opening up the file with chmod 0755 

Bingo, hook is now picked up.

Thanks for getting me on the right path at least!

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Oct 23, 2018 in Sourcetree

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

824 views 3 2
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