github.com使ってみた。公開してみた。

Andreessen Horowitz、GitHubに1億ドルを出資

http://japan.cnet.com/news/business/35019055/

gitは少し使ってきてなれてきたのですが、
OSSなど、いくつかのプロジェクトがgithubで公開されているのを利用させてもらったことはありますが
個人や会社で使う理由はわかりませんが、とりあえず使ってみます。

https://help.github.com/articles/create-a-repo

まずは空のリポジトリを作ると説明が出ます。

Global setup:
Set up git
 git config –global user.name “Your Name”
 git config –global user.email junichi.otake@gmail.com
Add your public key
     
Next steps:
 mkdir hello
 cd hello
 git init
 touch README
 git add README
 git commit -m ‘first commit’
 git remote add origin git@github.com:junichi-otake/hello.git
 git push -u origin master
     
Existing Git Repo?
 cd existing_git_repo
 git remote add origin git@github.com:junichi-otake/hello.git
 git push -u origin master

こんな感じだったので、最初にsshのキーを生成して設定するのが良いようです。

https://github.com/settings/ssh

https://help.github.com/articles/generating-ssh-keys

ファイル名は、id_rsaではなくgithub_id_rsaのようにしておく

/home/username/.ssh/github_id_rsa
/home/username/.ssh/configにgithub.comの設定を書く

HOST github.com
 IdentityFile ~/.ssh/github_id_rsa

ファイル指定のみ

公開鍵を登録してテスト

$ ssh -T git@github.com
Hi junichi-otake! You’ve successfully authenticated, but GitHub does not provide shell access.

Next Stepのところ通に進めると

$ git remote add origin git@github.com:junichi-otake/hello.git
$ git push -u origin master
Counting objects: 3, done.
Writing objects: 100% (3/3), 210 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
To git@github.com:junichi-otake/hello.git
* [new branch]      master -> master
Branch master set up to track remote branch master from origin.

こんな感じで更新出来た。

要らないので hello ⇒ Admin ⇒ deleteで削除。

とりあえず簡単なものでこの前書いたphpをほぼそのまま載せてみます。

git@github.com:junichi-otake/php-kyototycoon.git
README.mdだけある状態です。

cloneで落としてくる

$ git clone git@github.com:junichi-otake/php-kyototycoon.git .

README.mdを修正してみる。

http://daringfireball.net/projects/markdown/

http://github.github.com/github-flavored-markdown/

変更してそのままcommitしてpushすると更新出来ました。

検索するとたくさん出てくるtokenの設定などはよくわかりません、たぶん利用していない?みたいです。

https://github.com/junichi-otake/php-kyototycoon

ということで公開してみました。適当に使ってください。
ご質問等お気軽にどうぞ。
楽しい仕事があったら連絡ください。

This entry was posted on 水曜日, 7月 18th, 2012 at 4:24 PM and is filed under Kyototycoon/cabinet. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

Unityによるゲームを公開しております iOS/Android
https://itunes.apple.com/jp/app/lost-knight-3d-action/id900917032
https://play.google.com/store/apps/details?id=com.groundroad.runknight

各種開発支援・機能開発等小さいお仕事などもお請けしております。
unity開発支援, PHPシステム開発, javascript/html5 フロント開発, titanium mobileアプリ開発
お気軽にお問い合わせください
大崎・五反田近郊での対面でのお打ち合わせはいつでも可能です。