MacPortsでインストール
# sudo port install git-core +svn |
# sudo port install git-core +svn
エラーが出た
# Error: Target org.macports.activate returned: Image error:
/opt/local/lib/perl5/5.8.8/darwin-2level/auto/List/Util/Util.bs is
being used by the active perl5.8 port. Please deactivate this port
first, or use the -f flag to force the activation.
# Error: The following dependencies failed to build:
p5-scalar-list-utils p5-svn-simple subversion-perlbindings apr
apr-util cyrus-sasl2 neon serf subversion p5-term-readkey rsync popt
# Error: Status 1 encountered during processing. |
# Error: Target org.macports.activate returned: Image error:
/opt/local/lib/perl5/5.8.8/darwin-2level/auto/List/Util/Util.bs is
being used by the active perl5.8 port. Please deactivate this port
first, or use the -f flag to force the activation.
# Error: The following dependencies failed to build:
p5-scalar-list-utils p5-svn-simple subversion-perlbindings apr
apr-util cyrus-sasl2 neon serf subversion p5-term-readkey rsync popt
# Error: Status 1 encountered during processing.
そういえばportのアップデートなども行っていなかったな・・・ちゃんとやろう。
自分の環境では「/usr/local/src/localports」に設定してあったので、そこまで移動してportindex
# cd /usr/local/src/localports
# sudo portindex |
# cd /usr/local/src/localports
# sudo portindex
次にアップデートを行った
# sudo port -d selfupdate |
# sudo port -d selfupdate
# 既にgitをインストールされている場合はdeactivateする
# インストールされていないと下記のようにエラーが出る
# sudo port deactivate git-core
# Error: port deactivate failed: Registry error: git-core not
registered as installed & active. |
# sudo port deactivate git-core
# Error: port deactivate failed: Registry error: git-core not
registered as installed & active.
ではインストール
# sudo port install git-core +gitweb +svn
.........
---> Installing git-core @1.6.3.3_0+doc+gitweb+svn
---> Activating git-core @1.6.3.3_0+doc+gitweb+svn
---> Cleaning git-core |
# sudo port install git-core +gitweb +svn
.........
---> Installing git-core @1.6.3.3_0+doc+gitweb+svn
---> Activating git-core @1.6.3.3_0+doc+gitweb+svn
---> Cleaning git-core
インストール完了。これで準備が整ったので、そのままgithubに登録したのでその手順をメモメモ。
githubのURLはこちらgithub.comからアクセス可能
まずはユーザー登録するのだが、ここで「SSH Public Keys」を登録する項目があるのだが未入力でスルーした。
# 後で登録も出来るし追加もで出来るので問題無い。
登録すると自分のホーム画面となる。
github01 posted by (C)kishir
画面にある「Create a Repository」からレポジトリを作成する。リンクをクリックするとレポジトリの作成画面となる。
ここで入力するのはとりあえず「Project Name」だけでOK。
github02 posted by (C)kishir
そうするとgitのレポジトリが作成されて、設定方法が表示されるので指示に従って行う。
github03 posted by (C)kishir
# 今回は公開鍵を「id_rsa」では無く「github_id_rsa」で行っています。
# 参考ページはhttp://github.com/guides/providing-your-ssh-key#macosx-3
# ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/tom/.ssh/id_rsa): ← ファイル名はid_rsaでOK? いや今回は違う名前が良いので、github_id_rsaを打ってエンター
Enter passphrase (empty for no passphrase): ← パスワードの設定
Enter same passphrase again: ← 上記のパスワードを再入力
Your identification has been saved in /Users/.ssh/github_id_rsa.
Your public key has been saved in /Users/.ssh/github_id_rsa.pub. |
# ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/tom/.ssh/id_rsa): ← ファイル名はid_rsaでOK? いや今回は違う名前が良いので、github_id_rsaを打ってエンター
Enter passphrase (empty for no passphrase): ← パスワードの設定
Enter same passphrase again: ← 上記のパスワードを再入力
Your identification has been saved in /Users/.ssh/github_id_rsa.
Your public key has been saved in /Users/.ssh/github_id_rsa.pub.
これで公開鍵のペアが完成したので、そいつらを「.ssh」以下に移動
# mv github_id_rsa .ssh/
# mv github_id_rsa.pub .ssh/ |
# mv github_id_rsa .ssh/
# mv github_id_rsa.pub .ssh/
次に先ほど作成したgithub_id_rsaの中身をクリップボードへコピーする
# cat github_id_rsa.pub | pbcopy |
# cat github_id_rsa.pub | pbcopy
これでコピーされているはずなので、そのままgithubサイトの公開鍵設定のテキストエリアへ貼り付ける。
# 公開鍵は会社用や自宅用など複数の設定が可能
configファイルの設定は「.ssh/config」
に下記を追記する。
これはホスト名が「github.com」の場合は、この設定で行うよ!ってことがつらつらと書かれている。
# githubサイトに記載されている
Host github.com
User git
Port 22
Hostname github.com
IdentityFile ~/.ssh/github_id_rsa
TCPKeepAlive yes
IdentitiesOnly yes |
Host github.com
User git
Port 22
Hostname github.com
IdentityFile ~/.ssh/github_id_rsa
TCPKeepAlive yes
IdentitiesOnly yes