[メモ] githubからファイルをダウンロードする方法。

AIX、UNIX、Linux

githubからファイルをダウンロードする方法が分からなかったのでメモ。tarとかをダウンロードするのもいいけど、こういう方法もあるよと自分が分からなかったので備忘録代わりとする。

POINT

Fedora 16で確認。

手順

1. とりあえず必要パッケージをインストールする。

% yum install git
updates/metalink | 8.2 kB 00:00
updates | 4.5 kB 00:00
updates/primary_db | 5.8 MB 00:00
Resolving Dependencies
--> Running transaction check
---> Package git.x86_64 0:1.7.7.6-1.fc16 will be installed
--> Processing Dependency: perl-Git = 1.7.7.6-1.fc16 for package: git-1.7.7.6-1.fc16.x86_64
--> Processing Dependency: rsync for package: git-1.7.7.6-1.fc16.x86_64
--> Processing Dependency: perl(Git) for package: git-1.7.7.6-1.fc16.x86_64
--> Processing Dependency: perl(Error) for package: git-1.7.7.6-1.fc16.x86_64
--> Running transaction check
---> Package perl-Error.noarch 1:0.17016-6.fc16 will be installed
---> Package perl-Git.noarch 0:1.7.7.6-1.fc16 will be installed
---> Package rsync.x86_64 0:3.0.8-2.fc16 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==============================================================================
====================
Package Arch Version Repository Size
==============================================================================
====================
Installing:
git x86_64 1.7.7.6-1.fc16 updates 3.0 M
Installing for dependencies:
perl-Error noarch 1:0.17016-6.fc16 fedora 30 k
perl-Git noarch 1.7.7.6-1.fc16 updates 40 k
rsync x86_64 3.0.8-2.fc16 updates 339 k

Transaction Summary
==============================================================================
====================
Install 1 Package (+3 Dependent packages)

Total download size: 3.4 M
Installed size: 13 M
Is this ok [y/N]: y
Downloading Packages:
(1/4): git-1.7.7.6-1.fc16.x86_64.rpm | 3.0 MB 00:00
(2/4): perl-Error-0.17016-6.fc16.noarch.rpm | 30 kB 00:00
(3/4): perl-Git-1.7.7.6-1.fc16.noarch.rpm | 40 kB 00:00
(4/4): rsync-3.0.8-2.fc16.x86_64.rpm | 339 kB 00:00
------------------------------------------------------------------------------
--------------------
Total 2.1 MB/s | 3.4 MB 00:01
Running Transaction Check
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : 1:perl-Error-0.17016-6.fc16.noarch 1/4
Installing : rsync-3.0.8-2.fc16.x86_64 2/4
Installing : perl-Git-1.7.7.6-1.fc16.noarch 3/4
Installing : git-1.7.7.6-1.fc16.x86_64 4/4
Verifying : 1:perl-Error-0.17016-6.fc16.noarch 1/4
Verifying : perl-Git-1.7.7.6-1.fc16.noarch 2/4
Verifying : rsync-3.0.8-2.fc16.x86_64 3/4
Verifying : git-1.7.7.6-1.fc16.x86_64 4/4
Installed:
git.x86_64 0:1.7.7.6-1.fc16
Dependency Installed:
perl-Error.noarch 1:0.17016-6.fc16 perl-Git.noarch 0:1.7.7.6-1.fc16 rsync.x86_64 0:3.0.8-2.fc16

Complete!
%

2. ダウンロードしたいファイル(レポジトリ?)のページで、「Git Read-Only」を選択し、以下のURLをコピーする。

git://github.com/xxxxxx/xxxxxx.git

3. 以下のようにコマンドを入力し、実行する。

git clone git://github.com/xxxxxx/xxxxxx.git

4. カレントディレクトリにレポジトリがコピーされることを確認する。

以上。

参考

参考にさせていただいたWebサイト。

この記事を書いた人

kometchtech

うつ病を患いながら、IT業界の末席にいるおっさんエンジニア。科学計算をしたことがないのに、HPC分野にお邪魔している。興味のある分野で学習したことをblogにまとめつつ、うつ病の経過症状のメモも置いておく日々。じつはRouterboard User Group JPの中の人でもある。 Amazon欲しいものリスト / Arm板を恵んでくれる人募集中

kometchtechをフォローする
タイトルとURLをコピーしました