github その1

今噂のgithubを利用してみる。

  1. アカウント作成。
    • 完了。
  2. macでgitのセットアップ
  3. の前にMacPortsを設定しないといけないのか。。。。
  4. あとはリポジトリを作成してコミットしたらでけた。すげー。

空のディレクトリを追加するには?

.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

commit と push と pullの関係

git commit -m ’second commit’
commitで、ローカルリポジトリに変更を反映
git push origin master
pushで、リモートリポジトリに変更を反映
git pull origin master
ローカルリポジトリにリモートリポジトリの内容を反映させる。

http://blog.champierre.com/archives/670