ablog

不器用で落着きのない技術者のメモ

github を使ってみた

ちょっとしたスクリプトや .zshrc などをインターネット上において、いつでもどこでもダウンロードしたり更新したりできるようにしたいと思い、github を使ってみた。

  • git-1.6.3.3-intel-leopard を開き、ウイザードに従ってインストールする。




% vi ~/.zshrc
# Git
export PATH=$PATH:/usr/local/git/bin
export MANPATH=$MANPATH:/usr/local/git/man
% source .zshrc
% cd ~/.ssh 
% cat id_rsa.pub| pbcopy
% vi ~/.ssh/config
Host github.com
  User git
  Port 22
  Hostname github.com
  IdentityFile ~/.ssh/id_rsa
  TCPKeepAlive yes
  IdentitiesOnly yes
  • github に接続できるか確認してみる。(↓)いけてそうな気がする〜
% ssh git@github.com
PTY allocation request failed on channel 0
Hi yoheia! You've successfully authenticated, but GitHub does not provide shell access.
       Connection to github.com closed.
git config --global user.name "yoheia"
git config --global user.email ******@gmail.com
% mkdir -p ~/Documents/git/yoheia
% cd ~/Documents/git/yoheia
% git init
Initialized empty Git repository in /Users/yohei/Documents/git/yoheia/.git/
% touch README
% git add README
% git commit -m 'first commit'
[master (root-commit) 20f872d] first comment
 0 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 README
% git remote add origin git@github.com:yoheia/yoheia.git
% git push origin master
Counting objects: 3, done.
Writing objects: 100% (3/3), 205 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
To git@github.com:yoheia/yoheia.git
 * [new branch]      master -> master

とりあえず、ファイルを commit するところまでできた。


[参考]
http://soozy.org/index.cgi?CodeHostingComparison
404 Blog Not Found:tips - svnメイン、でもgithubでも公開したい場合の最小手順
Redirecting...