github.com使ってみた。公開してみた。
Andreessen Horowitz、GitHubに1億ドルを出資
http://japan.cnet.com/news/business/35019055/
gitは少し使ってきてなれてきたのですが、
OSSなど、いくつかのプロジェクトがgithubで公開されているのを利用させてもらったことはありますが
個人や会社で使う理由はわかりませんが、とりあえず使ってみます。
https://help.github.com/articles/create-a-repo
まずは空のリポジトリを作ると説明が出ます。
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の設定を書く
IdentityFile ~/.ssh/github_id_rsa
ファイル指定のみ
公開鍵を登録してテスト
Hi junichi-otake! You’ve successfully authenticated, but GitHub does not provide shell access.
Next Stepのところ通に進めると
$ 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で落としてくる
README.mdを修正してみる。
http://daringfireball.net/projects/markdown/
http://github.github.com/github-flavored-markdown/
変更してそのままcommitしてpushすると更新出来ました。
検索するとたくさん出てくるtokenの設定などはよくわかりません、たぶん利用していない?みたいです。
https://github.com/junichi-otake/php-kyototycoon
ということで公開してみました。適当に使ってください。
ご質問等お気軽にどうぞ。
楽しい仕事があったら連絡ください。