<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                [TOC] # Branches aren't just for Birds - 建立一個feature branch ## Branches Git 的 repositories 用 分支 branches來隔離進度。當需要跟其他人一起進行專案時,在你完成負責的部份之前,經常需要利用分支 branch來保護你對程序所做的修改。如此,你就可以讓**'master' branch**保持穩定,不被未完成的修改影響。等到你完成在 branch 上的修改,就可以把它 合并 merge 回'master' 分支 branch。 ![](https://box.kancloud.cn/f3ff4e658a23f1fe567c96ad56f23fc9_715x299.png) 在GitHub Guide 中我們有提供解釋 branches運作方式的示意圖:[guides.github.com/overviews/flow](https://guides.github.com/overviews/flow/) ## GitHub Pages GitHub 會自動發布你放在'gh-pages' branch里的靜態檔案,并架設一個網站。由于你 forked 的項目內容是一個網站,所以它的預設 branch是'gh-pages' 而不是'master'。而你會發現這些網站,網址都長得像這樣: ``` http://githubusername.github.io/repositoryname ``` ## 步驟:新增 分支 branch 當你新增 分支 branch 的時候,Git 會拷貝目前 分支 branch 上所有的檔案到新的 分支 branch。 在命令行輸入`git status`可以知道目前你在哪個分支 branch(應該會在'gh-pages')。 新增一個 分支 branch并命名為`「add-<username>」`,請用你的帳號名稱替換掉'username'。例如「add-jlord」。**分支 Branches 的名字有分大小寫,所以請確定輸入的帳號名稱跟GitHub 上顯示的一模一樣。** ``` $ git branch <BRANCH_NAME> ``` 水啦!你擁有了一個全新、內容跟'gh-pages' 一模一樣的分支 branch! 就像命令行去另一個文件夾的指令`cd`一樣,請 `checkout` 到剛才新增的 分支 branch: ``` $ git checkout <BRANCH_NAME> ``` ## 步驟:新增文件 接下來我們回到文字編輯器: * 新增一個文件并命名為`「add-<USER_NAME>.txt」`,請用你的帳號名稱替換'username',像這樣,「add-jlord.txt」。 * 在檔案里寫下你的GitHub 帳號名稱。例如,我就會寫'jlord'。 * 將檔案存到在Patchwork里的'contributors'資料夾:**Patchwork/contributors/add-yourusername.txt** * 接著,把你的修改記錄下來! ## 步驟:記錄 按照以下的步驟,把剛才的修改用Git 記錄下來: ``` $ git status $ git add <FILE_NAME> $ git commit -m "<commit message>" ``` 推送 Push 剛才記錄好的修改到GitHub 上,你 forked 的 代碼庫 repository 里頭: ``` $ git push origin <BRANCH_NAME> ``` ## File NOT in contributors folder 剛才新增的文件應該要放到Patchwork 代碼庫的'contributors'資料夾里。如果不小心放到別的地方,請打開Finder或是Windows的資源管理器將該文件移到'contributors'資料夾,然后可以用`git status`看你剛才移動文件之后所造成的結果。用以下的指令預備 Stage 并且 提交 commit 全部的修改(加上`-A`,會將新增文件跟刪除文件的動作一起記錄下來): ``` $ git add -A $ git commit -m "move file into contributors folder" ``` **分支 Branch name expected: _____** 分支 Branch的名字應該要跟你的帳號名稱一模一樣。用以下的指令修改分支 branch 的名字: ``` $ git branch -M <NEW_BRANCH_NAME> ``` ## Tips 只用一個指令就新增并切換到新的 分支 branch ``` $ git checkout -b <BRANCHNAME> ``` 創建新分支 branch ``` $ git branch <BRANCHNAME> ``` 切換到另一個 分支 branch ``` $ git checkout <BRANCHNAME> ``` 列出所有的 分支 branches ``` $ git branch ``` 重新命名目前所在的 分支 branch ``` $ git branch -m <NEWBRANCHNAME> ``` 看目前正在哪個 branch 上 ``` $ git status ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看