github その1
今噂のgithubを利用してみる。
- アカウント作成。
- 完了。
- macでgitのセットアップ
- の前にMacPortsを設定しないといけないのか。。。。
- 以下を参考にした
- http://lapangan.net/darwinports/index.php?TheMacPortsWiki%2FInstallingMacPorts#r2bfd479
- 定期的に、sudo port selfupdateを実行する必要あり。
- あとはリポジトリを作成してコミットしたらでけた。すげー。
空のディレクトリを追加するには?
.gitignoreを作ってaddする。
$ mkdir tmp
$ touch tmp/.gitignore
$ git add tmp
$ git push origin master
タグをつけるには??
- タグをつければ、特定のバージョンをピン留めできる。
$ git tag <バージョン名>
ex) $ git tag v2.1.0タグの一覧表示
$ git tag
- 任意のバージョンのソースコードをダウンロードもできる。
$ git archive --format=zip v2.1.0 > src.v2.1.0.zip
- このページが参考になる。http://granzchesta.blog.drecom.jp/archive/746
commit と push と pullの関係
git commit -m ’second commit’
http://blog.champierre.com/archives/670
commitで、ローカルリポジトリに変更を反映
git push origin master
pushで、リモートリポジトリに変更を反映
git pull origin master
ローカルリポジトリにリモートリポジトリの内容を反映させる。