<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>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # Scratch3.0——克隆代碼的正確姿勢 [![](https://upload.jianshu.io/users/upload_avatars/1467184/95ae0015-2f6d-4456-8725-ff2d69f92ac1.jpg?imageMogr2/auto-orient/strip|imageView2/1/w/96/h/96)](https://www.jianshu.com/u/939ffcc5f39a) [帷幄庸者](https://www.jianshu.com/u/939ffcc5f39a) 2019.01.22 23:57:55字數 477閱讀 2,837 [https://blog.csdn.net/weiwoyonzhe/article/details/86603450](https://blog.csdn.net/weiwoyonzhe/article/details/86603450) > 對Scratch3.0進行二次開發,首先要在github上fock[官方代碼](https://github.com/LLK/scratch-gui.git),但是在自己開發的同時又要跟進官方的代碼就要在git做如下配置。 #### 步驟: 1、配置上游項目地址。即將你 fork 的項目的地址給配置到自己的項目上。使用以下命令來配置。 ~~~csharp ? git remote add upstream https://github.com/LLK/scratch-gui.git ~~~ 然后可以查看一下配置狀況,很好,上游項目的地址已經被加進來了。 ~~~cpp ? git remote -v origin https://github.com/***/scratch-gui.git (fetch) origin https://github.com/***/scratch-gui.git (push) upstream https://github.com/LLK/scratch-gui.git (fetch) upstream https://github.com/LLK/scratch-gui.git (push) ~~~ 2、獲取上游(官方)項目更新。使用 fetch 命令更新,fetch 后會被存儲在一個本地分支 upstream/master 上。如果長時間沒有更新,可能會非常慢,一定要在網絡環境好的情況下更新或從GitHub下載代碼。 ~~~undefined ? git fetch upstream ~~~ 3、合并到本地分支。切換到 master 分支,合并 upstream/master 分支。 ~~~undefined ? git merge upstream/master ~~~ 如果提示: fatal: refusing to merge unrelated histories,這是因為本地和遠端已經是兩個獨立的版本庫,git認為是不相干的版本庫。 ~~~undefined ? git merge upstream/master --allow-unrelated-histories ~~~ 4、合并沖突。因為是在原先代碼的基礎上二次開發,沖突不可避免,而最費時間的也是這里解決沖突這一步。 5、提交推送。根據自己情況提交推送自己項目的代碼。 ~~~undefined ? git push origin master ~~~ 由于項目已經配置了上游項目的地址,所以如果 fork 的項目再次更新,重復步驟 2、3、4即可。 #### 留幾個問題供大家思考交流: 1. 沖突在所難免,在開發中注意什么可以更快更高效的解決沖突合并代碼? 2. 如果官方代碼重構了某部分模塊,你的代碼嚴重依賴該模塊該如何處理?
                  <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>

                              哎呀哎呀视频在线观看