photo credit: atduskgreg via photopin cc
今回はgitをcentos環境にインストールしてssh経由でelicpseにgit用のプロジェクトを作成してコミットしてみるまでの流れを公開してみます!
centosにgitをインストール
ファイルの取得
$ cd /usr/local/src
rpmforge-releaseファイルの最新版を http://pkgs.repoforge.org/rpmforge-release/ から取得する
$ wget http://dag.wieers.com/packages/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm $ wget http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt
rpmforge-releaseのrpmパッケージインストール
$ rpm -ivh rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
gitインストール
$ yum -y --enablerepo=rpmforge install git
レポジトリを作成する
git用のユーザー作成
$ adduser gituser $ passwd gituser Password : ****
gituserになった上でレポジトリ作成
$ su - gituser
プロジェクト名をtstciとして/tmp/tstciにgit作業用フォルダを作成する
$ mkdir /tmp/tstci $ cd /tmp/tstci $ git init $ touch test.txt $ git add . $ git commit -m "first commit"
/var/reposにレポジトリ用のフォルダを作成してレポジトリを作成する
$ mkdir /var/repos $ cd /var/repos $ git clone --bare /tmp/tstci $ cd /var/repos/tstci.git $ cd touch tstci-daemon-export-ok
Windows(Eclipse)からCentOS上のレポジトリをインポートする
Eclipseを起動後、Egitのプラグインをインストールしておく。
その後、「ファイル」→「インポート」
「Gitからプロジェクト」を選んで「次へ」
以下の様に、設定して「次へ」。ホスト名と環境によって変化するので注意
最後に「PHPプロジェクト」を選びgit用のプロジェクトがeclipse上に完成!
[…] 引用元: gitインストールし、レポジトリ作成後にeclipseでSSH接続する | 株式会社アルベ | Arubeh Inc.. […]