林一
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    簡單版的 Github 版控方式,讓新手們能簡單上手,但並不正規。 [toc] ## Git 環境 ### Ubuntu ```bash sudo apt-get install git-all ``` 如何使用:在該資料夾內打開 Terminal,即可輸入指令 ### Windows [Download for Windows](https://git-scm.com/download/win) 如何使用:對該資料夾右鍵,點擊 Git Bash ![](https://hackmd.io/_uploads/HkVEdgJsn.png) ### 基本操作 #### 1. 設置好個人資料 ```bash # 設定 git config --global user.name "<yourname>" git config --global user.email "<youremail@gmail.com>" # 查詢 config git config --list ``` <img src="https://github.com/tana0101/NTOU_Arrays_Start_at_One/blob/main/basic/Print%20Screen/git%20config.png?raw=true" alt="Cover" width="60%"/><BR> #### 2. 將 repositories 存入本地 ```bash # https git clone https://github.com/name/Hello-World.git # SSH git clone git@github.com:name/Hello-World.git ``` #### 3. 如何開始操作 對該 Repositorie 資料夾開啟 Git bash 或 Terminal,即可輸入指令。 ## 使用方式 ### 簡單的流程 - 先有 main 與 dev 兩個分支: - main:上線給使用者使用的版本 - dev:新功能上傳到此分支做測試 - 步驟: 創建一個功能的分支 -> 完成此功能 -> 將新功能連同分支合併到 dev -> 合併後就刪除該分支(網站上會問你要不要刪掉) ### 操作示範 1. [從 dev 創建新分支,並在此分支撰寫新功能](https://hackmd.io/glOfHCrjQV-lNngFaDOiOw?view#1-%E6%9C%AC%E5%9C%B0%E5%88%86%E6%94%AF%E6%93%8D%E4%BD%9C) `git switch -c add-login-function` 2. [每完成一個環節就做紀錄與推送](https://hackmd.io/glOfHCrjQV-lNngFaDOiOw?view#2-%E5%A6%82%E4%BD%95%E6%8E%A8%E9%80%81%E8%88%87%E5%8F%96%E5%BE%97) - 加入所有本地修改 `git add .` - 加入本次修改的訊息 `git commit -m "Feat: Add input box."` - 上傳到遠端 Repository `git push git push --set-upstream origin add-login-function` (第一次要設置 upstream) - 之後的每次修改如下 `git add .` `git commit -m "Feat: Add button."` `git push` (已經設置 upstream 就能直接push) 3. [完成功能後,就能丟回原來的分支](https://hackmd.io/glOfHCrjQV-lNngFaDOiOw?view#3-%E5%88%86%E6%94%AF%E5%90%88%E4%BD%B5%E3%80%81%E8%88%87%E5%85%B6%E4%BB%96%E4%BD%BF%E7%94%A8%E8%80%85%E4%BA%92%E5%8B%95%EF%BC%9APull-Request%EF%BC%88PR%EF%BC%89) 到 Github 上的 Repository,去建立 Pull Request ![](https://hackmd.io/_uploads/BycIkbyin.png) 接著寫標題,以及敘述本分支做了哪些事情,也能放圖片。 4. 之後的每個新功能都按照1->2->3的流程進行 <br> - 注意: - 請不要寫無用的 git commit ,應按照 Commit 守則。 - 請敘述清楚 Pull Request(PR)。 - 請善用分支操作,否則團隊難以協同。 - 團隊應該要互相 review code,確保一致性、可讀性。 ## 常用指令 ### 1. 本地分支操作 ```bash # 轉移並新增 branch git switch -c <branch_name> # 轉移到 branch git switch <branch_name> ``` ### 2. 如何推送與取得 ```bash # 加入所有修改內容 git add . # 此次上傳的描述 git commit -m "message" # 上傳到 origin 的 branch_name 分支 git push # 將修改內容下載到本地 git pull ``` #### [應遵守 Commit 守則](https://hackmd.io/@dh46tw/S1NPMsy5L#%E4%B8%80%E3%80%81%E7%82%BA%E4%BB%80%E9%BA%BC%E8%A6%81%E5%AF%ABGit-Commit-Message) 比如:`git commit -m "Feat: Add input box."` |類型 |說明 |程式碼改動| | -------- | -------- | -------- | |Feat |新功能。 |有| |Modify |既有功能需求調整的修改。 |有| |Fix |錯誤修正。 |有| |Docs |更新文件,如 README.md。 |沒有| |Style |程式碼格式調整(formatting)、缺少分號(missing semi colons)等。 |沒有| |Refactor |重構。針對已上線的功能程式碼調整與優化,且不改變記有邏輯。 |有| |Test |測試。新增測試、重構測試等 |沒有| |Chore |更新專案建置設定、更新版本號等瑣事。 |沒有| |Revert |撤銷之前的commit。 revert: type(scope): subject (回覆版本:xxxx) |有| 節錄於 [Git Commit Message 格式與規範整理](https://hackmd.io/@dh46tw/S1NPMsy5L#%E4%B8%80%E3%80%81%E7%82%BA%E4%BB%80%E9%BA%BC%E8%A6%81%E5%AF%ABGit-Commit-Message) ### 3. 分支合併、與其他使用者互動:Pull Request(PR) #### 流程: 建立 PR -> 給大家 review 確認沒問題或是利用留言 -> 自己合併或是讓其他使用者合併 #### 主要功能: 1. 設置 Reviewers:讓其他人收到 review 程式碼的通知,並且給建議。 2. 設置 Development 可以去綁定此 PR 跟那些 Issue 有關係,比如這個 PR 是修復某種 BUG,就可以把該 BUG 的 Issue 連接進來,方便釐清關係。 ![](https://hackmd.io/_uploads/B1o-GZysh.png)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully