5

Let's say I have one project in PhpStorm IDE, and within it I have many Git repositories (1 framework module = 1 repo). I just want to ask how to pull changes from all those repositories at once?

I know, that I can commit or push changes on repo massively, but when pulling, it asks me for single Git root.

Jazi
  • 6,569
  • 13
  • 60
  • 92
  • Since 2018.10, submodules are supported by IDEAs VCS module: https://youtrack.jetbrains.com/issue/IDEA-64024 It should now just "work" as you pull from the parent. – Kaii Feb 18 '19 at 09:42

1 Answers1

1

You could either:

  • use submodule (which can be tricky), to pull all subrepos as submodules

    git submodule update --rebase --remote
    
  • or script it as in this gist

    find . -name .git -type d \
    | xargs -n1 -P4 -I% git --git-dir=% --work-tree=%/.. remote update -p
    

In both instances, you would need to declare an external tool on the External Tool page of PhpStorm.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I presume, that your 2nd option is a script for linux ;)? (windows here) – Jazi Aug 19 '16 at 07:55
  • @KrzysztofTrzos No; if you have git installed, all those commands are in `/usr/bin`. If you make a script starting with #!/bin/bash and called `git-xxx` (no extension), you will be able to call it (form PhpStorm if you want) with `git xxx`, and that shell script will be interpreted by the msys2 shell from Git, provided that `git` and that scripts are both in the `%PATH%`. – VonC Aug 19 '16 at 07:57