4
1
From Bash it's simple:
for d in *; do GIT_DIR="$d/.git" git pull; done
Or:
for d in *; do GIT_DIR="$PWD/$d/.git" git pull; done
However from Windows Command Prompt it's not quite as simple. I've tried:
for /D %i in (*.*) do cd "%i" && git pull
for /D %i in (*.*) do cd "<absolute_path>\%i" && git pull
for /D %i in (*.*) do set GIT_DIR="<absolute_path>\%i\.git git pull"
for /D %i in (*.*) do set GIT_DIR="<absolute_path>\%i\.git && git pull"
But none work. Always getting one of these errors:
fatal: unable to access '"repo-name/.git" /config': Invalid argument
The system cannot find the path specified.
are you sure this doesn't work
c:\sdf>for /D %i in (*.*) do (CD c:\sdf\%i && DIR && pause)
use the pause to troubleshoot. Another variation isc:\sdf>for /D %i in (*.*) do (CD %i && DIR && CD .. && PAUSE)
andc:\sdf>for /D %i in (*.*) do (PUSHD %i && DIR && POPD && PAUSE)
– barlop – 2015-03-20T10:32:48.197if you see the FOR is doing what you want, and get it to do what you want, then you can look at the GIT command – barlop – 2015-03-20T10:42:47.537