Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,293,594
Community Members
 
Community Events
165
Community Groups

SourceTree: bulk git pull from repo browser

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

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.

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

@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

@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
Community showcase
Published in Sourcetree

Bug Fix: Sourcetree for Windows authentication error when updating to app password

Hello Sourcetree users!!! With the recent removal of Bitbucket Cloud account passwords for app passwords (please see our Bitbucket Cloud community post for details on why we made this change for se...

60,318 views 127 26
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you