內容標題

  1. .gitignore
  2. license 和 README
  3. Markdown 語法
  4. 結語

.gitignore

當我們想把檔案交給 git 管理時,總會有些檔案是不想被控管或儲存的,於是我們可以在資料夾內創立 .gitignore 檔案。因此,當 git 搜尋到這個檔案時,他會查看內部有哪些檔案是不想被監控的。例如:

# 用 vim 編輯 .gitignore
$ vim .gitignore
# 忽略 test.cpp檔
test.cpp

# * 代表是所有,因此 *.py 代表所有結尾是 .py 的檔案
*.py

接下來直接看個例子:

# 創立 test.cpp test.py hello.py
$ touch test.cpp test.py hello.py

# 用 git status 查看狀態
$ git status
On branch master

No commits yet

Untracked files:
  (use "git add <file>..." to include in what will be committed)
    .gitignore
    hello.py
    test.cpp
    test.py

nothing added to commit but untracked files present (use "git add" to track)

# 創立 .gitignore
$ vim .gitignore

# 再看一次 git status
$ git status
On branch master

No commits yet

Untracked files:
  (use "git add <file>..." to include in what will be committed)
    .gitignore

nothing added to commit but untracked files present (use "git add" to track)

此時就會發現 git 忽略了 test.cpp、test.py、hello.py

license 和 README

  • license
    雖然我們說 GitHub 上面的東西是可以使用的,但那還是基於使用者有授權。而授權方式就是加入 license,而 license 規範的便是他人如何使用這份資源。使用 license 的方式非常多,可以基於使用者的出發點來完成,可以參考這裡

    如果使用者沒有使用 license,在規定上是不開放下載與使用的,即使是公開的!

  • README
    README 是讓他人在閱覽文件時,能更快速了解文件的內容,或是向他人說明這些檔案要如何使用,有點像是使用說明。而 README 則是此用 Markdown 語法來撰寫的。事實上,Markdown 的語法可以轉成 htmltag,也就是如果用 html 的語法來寫也是可以,但 Markdwon 提供更簡潔有力的方式來呈現!

    如果想在 GitHub 上放 README,只要創建 README.md 並用 Markdown 語法來撰寫就可以了!或是在初始化 Repo 的時候,將創立 README 的欄位勾起來即可!

Markdown 語法

這邊就分享比較基本的語法,接下會分類來介紹:

  • 標題
    如果想要創造標題,就在文字前面加上 "#",可以加 1 到 6 個,1個是最大,6個是最小:

    # I'm big head

    ###### I'm small head
  • 文字
    文字的變花基本是由 "*" 和 "~" 來完成的,總共有 4 種變化:
    **我有加粗**
    *我是斜體 *
    ***我是粗斜體 ***
    ~~我被劃掉了~~

  • 序列

    1. 我是1
    2. 我是2
    • 我是無序 1
    • 我是無序 2
  • 引用

    想要引用 加個 ">" 在開頭

  • code section
    想要寫入 code 就用 ``` 包起來:
    ``` 語言種類
    我是內容物
    ```
    例如:
    ``` c
    # include <stdio.h>
    int main() {
    }
    ```
    就會變成:

    # include <stdio.h>
    int main() {
    }
    
  • image
    ![這是照片沒顯示所要顯示的文字](圖片網址)

  • url
    [顯示文字](網址) 例如:我是連結

如果想要跳脫引用或者編號的話,要空兩行喔!

結語

謝謝大家這七天的捧場~ 很高興自己可以完成這七天的創作,希望以後可以創作更多的作品與大家一同分享!那我們下次見!

#Git







你可能感興趣的文章

Day02 為資料命名

Day02 為資料命名

[FE301] React 基礎(Class component 版)先別急著學 React

[FE301] React 基礎(Class component 版)先別急著學 React

從找房子理解 ETL scheduling

從找房子理解 ETL scheduling






留言討論