Bash에서 간단합니다.
for d in *; do GIT_DIR="$d/.git" git pull; done
또는:
for d in *; do GIT_DIR="$PWD/$d/.git" git pull; done
그러나 Windows 명령 프롬프트에서 그리 간단하지 않습니다. 난 노력 했어:
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"
그러나 아무것도 작동하지 않습니다. 항상 다음 오류 중 하나가 발생합니다.
fatal: unable to access '"repo-name/.git" /config': Invalid argument
The system cannot find the path specified.
당신이에 대한 당신이 원하는 것을하고있다보고, 당신이 원하는 것을 얻을 경우, 당신은 GIT 명령을 볼 수 있습니다
—
barlop
c:\sdf>for /D %i in (*.*) do (CD c:\sdf\%i && DIR && pause)않습니까? 일시 정지를 사용하여 문제를 해결하십시오. 또 다른 변형은 다음c:\sdf>for /D %i in (*.*) do (CD %i && DIR && CD .. && PAUSE)과 같습니다.c:\sdf>for /D %i in (*.*) do (PUSHD %i && DIR && POPD && PAUSE)