Code Monkey home page Code Monkey logo

gitwebdoc's Introduction

網頁上傳GIT

除了可以利用GIT進行網頁程式碼的版本控管,也可以利用GIT當成靜態網頁的伺服器,唯一的限制,就是html檔案的名稱必須是index.html

主要有三件事要做:

  • 把網頁程式用git管理
  • 把網頁程式推送到git (第一個作業)
  • 把存在git的網頁用git page顯示(第二個作業)

把網頁程式用git管理

1)利用terminal確認一下網頁程式

2)利用git --version指令確認你已經安裝了git程式

3)利用git init指令把網頁程式用git管理版本

4)利用git add指令把所有的程式加入暫存

5)利用git commit -m "getweb"指令提交,就完成git管理網頁程式

把網頁程式推送到git

1)在github建立一個repository

2)隨你的專案取一個你喜歡的名字,並且要選定為Public

3)按下綠色的Create repository按鈕之後,就會出現這個Quick Setup畫面。因為我們的網頁已經在電腦端用git管理了,所以只要注意最下面的那兩行,把他複製到電腦的終端機(你在origin後面的專案路徑會與我這個不同)

git remote add origin https:///github.com/你的專案名稱
git push -u origin master

4)經過一小段時間之後,你的專案就被push到github。你在github的專案就可以看到網頁程式,這一頁的url就是作業一,你也就完成第一個作業

把存在git的網頁用git page顯示

1)接下來,同樣是這一頁。注意選單有一個Settings按鈕,把他按下

2)按下Settings之後就會進入設定畫面,往下滑到GitHub Pages區域,按下select source,把原本的none改選為master branch

3)選定之後按下save,設定頁面就會重刷一次,再度滑到GitHub Pages區域,你會發現GitHub已經給你的這個Git網頁程式設定了一個超連結,這個超連結,就是你要繳交的的二個作業

4)點選超連結,就可以看到這個靜態網頁已經在GitHub伺服器了

gitwebdoc's People

Contributors

chsyu avatar

Stargazers

Cicada17 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.