【志銀】Win764位配置Github環境及將代碼部署到Github pages-志銀強勢總結

(軟件及教程下載分享:連接:http://pan.baidu.com/s/1dFysay9 密碼:pug0)git

1-安裝Git-2.9.2-64-bit.exe(解壓安裝文件,運行安裝程序,除了記得修改下安裝路徑外就一路默認下一步安裝着去)github

 

2-鏈接配置Git環境:shell

2.1-首先在本地建立ssh key;bash

2.1.1-啓動Git Bash Here:ssh

2.1.2-輸入下面代碼,後面的your_email@youremail.com改成你在github上註冊的郵箱ide

$ssh-keygen -t rsa -C "your_email@youremail.com"  //郵箱填寫本身的git帳號spa

2.2-回到github上,進入 Account Settings(帳戶配置),左邊選擇SSH KeysAdd SSH Key,title隨便填,粘貼在你電腦上生成的key.3d

2.2.1-填加圖解:blog

2.2.2-驗證是否成功,在git bash下輸入:$ ssh -T git@github.com 教程

若是是第一次的會提示是否continue,

輸入yes就會看到:You've successfully authenticated, but GitHub does not provide shell access 。

這就表示已成功連上github。

 

3-把本地倉庫傳到github上去:

3.1-在此以前還須要設置一次username(用戶名)email(郵箱),這是很是重要的,由於github每次commit(提交)都會記錄他們

$ git config --global user.name "your name"

$ git config --global user.email "your_email@youremail.com"

個人: git config --global user.name " czy95"

      git config --global user.email "*******@qq.com"

查看配置信息: $ git config –list

3.2-新建一個github倉庫並增長分支:

3.2.1-新建一個github倉庫:

3.2.2-建立一個gh-pages分支:

3.3-Clone遠程倉庫到本地:

須要用到的命令:

$ git clone https://github.com/用戶名/庫名.git  //將git庫下載到本地

個人:$ git clone https://github.com/czy95/czy.git

$ cd 庫名  //進入下載好的庫文件目錄下

個人:$ cd czy

$ git checkout -b gh-pages origin/gh-pages  //切換到gh-paes分支

3.4-刪除裏面的全部文件,最好不要直接刪除,經過git命令刪除:

須要用到的命令:

$ git rm -rf .

$ git add .

$ git commit -m "delete all files"

3.5-提交代碼到gh-gages分支:

須要用到的命令:

$ git add .

$ git commit -m "add czyClock"  //最後面的參數至關於修改文件的備註

$ git push origin gh-pages  //將代碼提交到gh-gaes分支

4-完成查看效果:

 

Ok!!!

                                                   開始寫於:2016.10.12  ----志銀

相關文章
相關標籤/搜索