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

來源:互聯網
上載者:User

標籤:

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

1-安裝Git-2.9.2-64-bit.exe(解壓安裝檔案,運行安裝程式,除了記得修改下安裝路徑外就一路預設下一步安裝著去)

 

2-串連配置Git環境:

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

2.1.1-啟動Git Bash Here:

2.1.2-輸入下面代碼,後面的[email protected]改為你在github上註冊的郵箱

$ssh-keygen -t rsa -C "[email protected]"  //郵箱填寫自己的git帳號

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

2.2.1-填加圖解:

2.2.2-驗證是否成功,在git bash下輸入:$ ssh -T [email protected]

如果是第一次的會提示是否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 "[email protected]"

我的: 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  ----志銀

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

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.