pieceofr
    • 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
    • Make a copy
    • 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 Make a copy 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
    # RLadies 要上 Github By Rachael Pai 2017/03/27 ![](https://i.imgur.com/ncbIdKF.png) --- ## 為何 RLadies 要上 Github ? + 因為每次的 RLadies meetings 都很精彩,source code 與文件想要分享給更多人 + 因為 RLadies 有很多工作小組, 工作小組成員間要互相協作產出文件或 source code + 因為我們希望記錄下每一個人的貢獻 + 因為我們希望分享的 source code 有歷史紀錄,可以回復也可以更新 --- ## 甚麼是 Github 呢 ? 那麼要先了解什麼是 Git ? --- ## 甚麼是 Git 呢? + Distributed Version Control System / 分散式版本控制系統 + 檔案系統快照資料庫/倉庫的管理系統 + 資料庫 : Repository --- ## 甚麼是 Github 呢 ? + Wiki : GitHub是一個透過Git進行版本控制的軟體原始碼<B> 代管服務</B> + https://github.com/ + 提供 Git 的雲端服務的網站 --- ## 如何開始第一步 ? ---- ## 在 Github 上申請帳號 + github.com ---- ## 安裝 Git 到本地電腦 有以下太太太簡單的安裝方法 + ubuntu apt-get install git + linux yum install git + mac bew install git + windows 下載安裝檔, run exe 檔 + 或者請參考 Git 官網 https://git-scm.com/book/zh-tw/v1/%E9%96%8B%E5%A7%8B-%E5%AE%89%E8%A3%9DGit --- ## 開始 RLadies Github 的情境教學 --- ## 情境1 : 我參加了 RLadies 聚會, RBasic 教材太棒惹,我想要下載教材 ---- + 請上 Github (https://github.com/) + 搜尋 rladiestaipei or 進入 github.com/rladiestaipei/R-basic + copy clone 位址 + 在 command line 下 (ie. git bash) ``` git clone https://github.com/rladiestaipei/R-basic.git ``` + 你有了一份完整 R-basic Repository 的本地目錄了 + 你會發現 R-basic 教材都在你的本地電腦了 --- ## 情境2 : 我是 RBasic 工作小組成員,我要參加 RBasic 共同編輯 ---- ## Git 的 3 個 states + Modified (修改): 檔案有修改,但還沒commit 到本地資料庫 + Staging (已暫存): 幫檔案照快照 + Committed (已提交) : 檔案已經安全存放在你本地的資料庫 ---- ## Git 基本工作流程 + 取出某個版本的檔案 (from Repository) + -> 修改檔案 + -> 儲存 Stage 快照到 Staging Area + -> Commit 到Git 資料庫 (to loacl Repository) ---- ![](https://i.imgur.com/d2jbJOl.png) ---- ## 提交到遠端資料庫 (Remote) + Remote 這邊是指 github 上的 repository . + Remote 也可以是 gitlab, bitbucket 等 ---- R-Basic 共編 git 實作 ---- + 先跟情境1 一樣 clone 下你的目錄,擁有一份 Local Git Repository ``` git clone https://github.com/rladiestaipei/R-basic.git ``` ---- + 執行 Git 的 3 個 States ---- + Modified (修改檔案) + 使用 git status 看那些檔案有變化 ``` git status ``` + 使用 git diff 看看改了什麼 ``` git diff ``` ---- + Staging + 改好了沒問題, 使用 git add 把檔案加入 staged ``` git add filename git add . //加入全部被修改過的檔案 ``` ---- + committed + 使用 git commit 把 git 存入local repository ``` git commit -m "Add chapter 4" ``` + 使用 git log 看看 git commit history ``` git log ``` ---- + 上傳到遠端資料庫 + 使用 git pull 將 github 上最新的版本與自己的本地端的合併 ``` git pull ``` + 解決 Conflict + 使用 git push 把合併好的上傳到 github ``` git push ``` + 可以使用 git log -r 檢查一下 github 上是不是有你改的部分 ``` git log -r ``` --- ## 恭喜你,你已經可以使用 Git 跟 RLadies 協作了 --- ## 情境 1 與 2 我都會了, 接下來 ? --- ## 在 local 與 Github 上建立 Repository --- ## 取出某個版本: Git checkout ``` git checkout <hashnum> git checkout e3ec69f ``` --- ## 分支 : Git Branch ![](https://i.imgur.com/kJirkDi.png) ---- ## Git branch command ``` ## 列目前local 的 branches 跟所在 branch git branch ## 開一個新的 branch git branch <branchname> ## 開一個新的 branch 並且checkout到那個 branch git checkout -b <branchname> ``` ---- ## 分支管理 ---- ![](https://i.imgur.com/oVkhAeS.png) --- ## 更多 : reset revert merge rebase cherry-pick config ssh setup ... --- ## Q and A --- ## Thanks you! ###### tags: `rladies` `github` `git` `tutorial`

    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