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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

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

421 views 0 1
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