Can I customize the git commands within SourceTree?

I'm running into a problem with submodules, and would like SourceTree to *not* update them recursively (or at all). Is it possible to customize the git commands that SourceTree uses for fetch, pull, etc.?

2 answers

You can't change the internal options (beyond the checkboxes etc that are exposed in the UI), but you can create Custom Actions (Preferences > Custom Actions) to run your own commands instead. So you could define alternative Pull commands if you wanted.

I'm curious why you need to do so though, can you illustrate the issue you're having?

We have a very large, shared git repository with multiple projects. One of the projects started using git submodules, and since the majority of developers don't work on that project, they don't need to be constantly checking if the submodules are up-to-date (especially since "git pull" appears to do this automatically).

Also, we were running into a problem where one of the sub-sub-modules had a bad reference, and this showed up in SourceTree as errors EVERY time we fetch or pulled, whereas a simple fetch from the commandline didn't show any errors.

I know that SourceTree is trying to be smart about updating, but it would be nice to have the option to decide what the "pull" button does.

(It would also be nice to decide what the "push" button does so we can add our own pre-push hooks, but that's another feature request perhaps)

Mark, I suggest to fix the bad reference problem inside your repository and not just work-around the core reason.

Yes we obviously did that, but in the meantime dozens of us had to revert to the commandline to use git for a day. Not the best user experience, especially for our designers who exclusively use a git GUI because they don't know how to use the command line!

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...

960 views 4 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