LoginSignup
2

More than 5 years have passed since last update.

Gitコマンド(Clone編)

Posted at

Gitコマンド(Clone編)

カレントディレクトリ直下にリポジトリをコピーする

$ git clone <リモートリポジトリのアドレス>

例) GitHubにある、「sampleuser」ユーザの「samplerepo」リポジトリを「test」ディレクトリにコピーする

$ cd <testの親ディレクトリのパス>/test
$ git clone https://github.com/sampleuser/samplerepo-git.git
$ ls
samplerepo-git

指定したディレクトリにリポジトリの内容をコピーする

$ git clone <リモートリポジトリのアドレス> <宛先ディレクトリのパス>

例) GitHubにある、「sampleuser」ユーザの「samplerepo」リポジトリの内容を「test」ディレクトリにコピーする

$ git clone https://github.com/sampleuser/samplerepo-git.git
$ ls
src             test

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
2