SourceTree: bulk git pull from repo browser

Lio Eters January 5, 2015

I have a library of shared repos used in several projects, and I often need to perform git pull on some/all of them to make sure each project has an updated library.

In the Repository Browser view, I can see which ones have new commits and am able to select multiple repos. Upon right-click, there is an option for "Custom Actions" which seems like a good place for bulk git pull on all selected repos.  However, I couldn't find a way to add such a custom action.  Could you point me in the right direction to achieve this?

If it's not possible from the Repo Browser, what would you recommend as a solution to git pull multiple repos all at once, rather than one by one?

1 answer

0 votes
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 6, 2015
Lio Eters January 6, 2015

Thank you for the response. The link doesn't provide any solution unfortunately, only that it's not recommended to bulk git pull. I need a workable solution still, since it's not really practical to git pull 4~5 repos one at a time for each project. Submodules could solve this, although this feature has brought other issues for me in the past. Subtree might work well to update all shared repos for each project. I did find a way to add a Custom Action, and I remember seeing a bash script that goes through a directory, finds all repos and performs git pull. If I find a solution, I'll post back here for other people in a similar situation.

Daniel Willitzer September 24, 2015

@Lio Eters By chance did you find that script at all?

Lio Eters September 24, 2015

@Daniel Willitzer This is what I'm using currently, a line in ~/.bash_profile: alias git-update='for dir in ./*; do (if test -d "$dir/.git"; then echo "Updating $dir.." && cd "$dir" && git pull; fi); done' It runs git pull on all folders with a git repo, under the current working directory.

Like Alex Dev Pearce likes this
thijssen September 20, 2018

@Lio Eters Thank you, I'm new to git and this helps me alot.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events