Git 的安裝與使用
1、Create
github
Account (在github網站上創建一個賬號)
eg. you used the email: [email protected]
2、Download && install MsysGit
(下載windows平臺下的git軟件)
Then open the git bash , input the commends
$ git config --global user.name "Your Name"
Your Name 是你註冊時用的用戶名
$ git config --global user.email [email protected]
3、Create SSH-KEY (創建SSH-key)
$ ssh-keygen -C ' [email protected]' -t rsa
# The git bash ask you to enter something , but you can Skip everything ,
just push the " ENTER " key, when it 's finished,you need open the file: id_rsa.pub
And copy the key.
創建rsa, 一路回車,最後會提示你
Your public key has been saved in .... (某個地方) .pub 文件
打開這個文件,複製key。
登陸git網站,進入你的個人管理平臺,創建一個ssh key,title隨便填寫,下面的key粘貼此段代碼。
4、Create first project (創建你的第一個項目)
Loginto the github home and create your first project, Then you can see this page:
取個項目的名字,然後繼續.會看到操作步驟。
Global setup:
Download and install Git
git config --global user.name "Your Name"
git config --global user.email [email protected]
Next steps:
mkdir pool
cd pool
git init
touch README
git add README
git commit -m 'first commit'
git remote add origin [email protected]:squarezw/pool.git
git push origin master
在你的git bash下完成到這裏後,看到成功上傳項目後,即可直接跳到最下面的Continue!
如果出現Permission denied (publickey). 一般是你的ssh key沒有正確添加。
Existing Git Repo?
cd existing_git_repo
git remote add origin [email protected]:squarezw/pool.git
git push origin master
Importing a Subversion Repo?
Click here
When you're done:
Continue
未完待續....