LoginSignup
3
4

More than 5 years have passed since last update.

テキストに書いてあるURLを次々とgit cloneするBATファイル

Last updated at Posted at 2015-04-30

テキストファイルに書かれているURLを次々とgit cloneします。

使い方

以下に記述している「テキストファイル(list.txt)」と「次々とgit cloneするBATファイル(setup.bat)」を同一フォルダに格納し、「次々とgit cloneするBATファイル(setup.bat)」を実行します。

D:\Git-reposへ、次々にgit cloneされます。

テキストファイル(記述例)

[list.txt]

git@github.com:kunst1080/AnubisGG.git
https://github.com/freebsd/freebsd.git

次々とgit cloneするBATファイル

[setup.bat]

@echo off

set LIST=%~dp0list.txt
set DESTDIR=D:\Git-repos
set GIT="C:\Program Files (x86)\Git\bin\git.exe"

REM make directory
if not exist %DESTDIR% mkdir %DESTDIR%

REM Git clone
cd /d %DESTDIR%
for /f "usebackq tokens=1,2" %%a in (`type "%LIST%"`) do (
    echo git clone %%a %%b
    %GIT% clone %%a %%b
    echo.
)

※環境に応じて、環境変数「DESTDIR」と「GIT」の値は書き換えて下さい。

3
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
4