2013年7月19日 星期五

設定 自己的 Github


首先須要先去github 建立一個帳號. ex: xxx@gmail.com
$ git config --global user.email "xxx@gmail.com"
# Set a new email
$ git config --global user.email
# Verify the setting

在自己linux 環境下產生 public key
$ cd ~/.ssh
$ ssh-keygen -t rsa -C "xxx@gmail.com"
過程中 Enter 就好...

$ vi ~/.ssh/id_rsa.pub
 
然後把裡面的內容 paste 到 github 的 https://github.com/settings/ssh  (必須先登入)
另外你必須先去 github 建立一個 repo . EX: test
 
然後在自己的 linux 系統下執行:
mkdir test
cd test
git init
git touch
git add README
git commit -m "first commit "
git remote add origin git@github.com:your_name/test.git
git push -u origin master

參考連結:
https://help.github.com/articles/generating-ssh-keys
https://help.github.com/articles/pushing-to-a-remote

【下列文章您可能也有興趣】

沒有留言: