リモートにあるリポジトリを手元に複製するコマンドは?
正答
- git init https://example.com/app.git
- git pull https://example.com/app.git
- git fetch https://example.com/app.git
- git clone https://example.com/app.git
解説
git clone は履歴を含むリポジトリ全体をコピーし、複製元を origin という名前のリモートとして登録する。git init は空のリポジトリを新規作成するコマンドで、URL を渡しても複製にはならない。git pull や git fetch は既にリポジトリがある場所でリモートの更新を取り込むもので、何も無いディレクトリでは not a git repository になる。
参考: git-scm.com
この問題を含む Git のテストを制限時間つきで解く
Gitクイズへ