How to use Git Secrets with SourceTree?

Hi all,

our team decided to use "Git Secrets" (a fork of https://github.com/awslabs/git-secrets) in order to prevent team members to accidentally commit secrets (password, API Keys, ...) to Git. I also should mention that we're working on Mac OS X.

Using Git Secrets from the command line works just fine, and the new git command "git secrets <options>" is available. I figure this works as the command line has access to the PATH in which the respective scripts are being installed by Git Secrets. Git Secrets installs a special pre-commit-hook which checks what is has to check before allowing to commit.

Committing from within SourceTree however does not work anymore.

This is the error message I get:

 

git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree commit -q -F /var/folders/xn/1hl03gp55_3df0y1xl37tg900000gp/T/SourceTreeTemp.xNvMuf 
git: 'secrets' is not a git command. See 'git --help'.
Completed with errors, see above

 

My guess is that SourceTree does not have access to the PATH under which the additional command "secrets" is available. What brings me to this conclusion is the fact, that committing from within SourceTree does not work, if I start SourceTree from the Dock or via Spotlight. However, if I manually start SourceTree from the command line (by manually calling "/Applications/SourceTree.app/Contents/MacOS/SourceTree") it does work again.

 

So, my question:

Is there a way to configure things like this in SourceTree? Can I e.g. manually add a PATH and make it known to SourceTree? Or is there any other way around this in order to being able to commit from SourceTree again?

 

Thank you so much in advance for your help.

 

Cheers,

Andy

 

1 answer

This widget could not be displayed.

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Published May 30, 2018 in Sourcetree

Tip from the team: configuring Git or Mercurial in Sourcetree

Supported Platforms macOS Windows To make using Sourcetree as simple yet powerful as possible we embed (bundle) dependencies such as Git, Git LFS, and Mercurial. We strive to keep these...

729 views 1 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