<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 功能強大 支持多語言、二開方便! 廣告
                ## 執行wchar_support分支變化 Byron 工作在wchar_support分支。他改變了名稱的功能和測試后,他提交他的變化。 [byron@CentOS src]$ git branch master * wchar_support [byron@CentOS src]$ git diff 上面的命令產生以下結果 diff --git a/src/string_operations.c b/src/string_operations.c index 8fb4b00..01ff4e0 100644 --- a/src/string_operations.c +++ b/src/string_operations.c @@ -1,7 +1,7 @@ #include <stdio.h> #include <wchar.h> -size_t w_strlen(const wchar_t *s) +size_t my_wstrlen(const wchar_t *s) { const wchar_t *p = s; 驗證代碼后,他提交了他的變化。 [byron@CentOS src]$ git status -s M string_operations.c [byron@CentOS src]$ git add string_operations.c [byron@CentOS src]$ git commit -m 'Changed function name' [wchar_support 3789fe8] Changed function name 1 files changed, 1 insertions(+), 1 deletions(-) [byron@CentOS src]$ git push origin wchar_support 上面的命令會產生以下結果。 Counting objects: 7, done. Compressing objects: 100% (4/4), done. Writing objects: 100% (4/4), 409 bytes, done. Total 4 (delta 1), reused 0 (delta 0) To gituser@git.server.com:project.git 64192f9..3789fe8 wchar_support -> wchar_support ## 在主分支進行更改 同時在主分支Sampson 也改變了名稱相同的功能,并將其更改到主分支。 [sampson@CentOS src]$ git branch * master [sampson@CentOS src]$ git diff 上面的命令會產生以下結果。 diff --git a/src/string_operations.c b/src/string_operations.c index 8fb4b00..52bec84 100644 --- a/src/string_operations.c +++ b/src/string_operations.c @@ -1,7 +1,8 @@ #include <stdio.h> #include <wchar.h> -size_t w_strlen(const wchar_t *s) +/* wide character strlen fucntion */ +size_t my_wc_strlen(const wchar_t *s) { const wchar_t *p = s; 驗證差異后,他提交了他的變化。 [sampson@CentOS src]$ git status -s M string_operations.c [sampson@CentOS src]$ git add string_operations.c [sampson@CentOS src]$ git commit -m 'Changed function name from w_strlen to my_wc_strlen' [master ad4b530] Changed function name from w_strlen to my_wc_strlen 1 files changed, 2 insertions(+), 1 deletions(-) [sampson@CentOS src]$ git push origin master 上面的命令會產生以下結果。 Counting objects: 7, done. Compressing objects: 100% (4/4), done. Writing objects: 100% (4/4), 470 bytes, done. Total 4 (delta 1), reused 0 (delta 0) To gituser@git.server.com:project.git 64192f9..ad4b530 master -> master strchr 函數在分支Byron 實現 wchar_support寬字符字符串。經過測試,他提交和推送其變化 wchar_support 分支。 [byron@CentOS src]$ git branch master * wchar_support [byron@CentOS src]$ git diff 上面的命令會產生以下結果。 diff --git a/src/string_operations.c b/src/string_operations.c index 01ff4e0..163a779 100644 --- a/src/string_operations.c +++ b/src/string_operations.c @@ -1,6 +1,16 @@ #include <stdio.h> #include <wchar.h> +wchar_t *my_wstrchr(wchar_t *ws, wchar_t wc) +{ + while (*ws) { + if (*ws == wc) + return ws; + ++ws; + } + return NULL; +} + size_t my_wstrlen(const wchar_t *s) { const wchar_t *p = s; 驗證變化后,他提交他的變化。 [byron@CentOS src]$ git status -s M string_operations.c [byron@CentOS src]$ git add string_operations.c [byron@CentOS src]$ git commit -m 'Addded strchr function for wide character string' [wchar_support 9d201a9] Addded strchr function for wide character string 1 files changed, 10 insertions(+), 0 deletions(-) [byron@CentOS src]$ git push origin wchar_support 上面的命令會產生以下結果。 Counting objects: 7, done. Compressing objects: 100% (4/4), done. Writing objects: 100% (4/4), 516 bytes, done. Total 4 (delta 1), reused 0 (delta 0) To gituser@git.server.com:project.git 3789fe8..9d201a9 wchar_support -> wchar_support ## 對付沖突 Sampson想看,Byron 在他的私人分支做什么?這就是為什么他試圖從wchar_support分支把最新的修改,但Git 放棄操作在得到錯誤消息后。 [sampson@CentOS src]$ git pull origin wchar_support 上面的命令會產生以下結果。 remote: Counting objects: 11, done. 63Git Tutorials remote: Compressing objects: 100% (8/8), done. remote: Total 8 (delta 2), reused 0 (delta 0) Unpacking objects: 100% (8/8), done. From git.server.com:project * branch wchar_support -> FETCH_HEAD Auto-merging src/string_operations.c CONFLICT (content): Merge conflict in src/string_operations.c Ausampsonatic merge failed; fix conflicts and then commit the result. ## 解決沖突 從錯誤消息很顯然知道,是有沖突的在src/string_operations.c。他運行 git diff 命令查看進一步的細節。 [sampson@CentOS src]$ git diff 上面的命令會產生以下結果。 diff --cc src/string_operations.c index 52bec84,163a779..0000000 --- a/src/string_operations.c +++ b/src/string_operations.c @@@ -1,8 -1,17 +1,22 @@@ #include <stdio.h> #include <wchar.h> ++<<<<<<< HEAD +/* wide character strlen fucntion */ +size_t my_wc_strlen(const wchar_t *s) ++======= + wchar_t *my_wstrchr(wchar_t *ws, wchar_t wc) +{ + + while (*ws) { if (*ws == wc) + return ws; + ++ws; + } + return NULL; +} + + size_t my_wstrlen(const wchar_t *s) ++>>>>>>>9d201a9c61bc4713f4095175f8954b642dae8f86 { const wchar_t *p = s; 由于Sampson 和Byron 在相同的功能更改的名稱,Git不知道如何去做,因此這就是為什么它要求用戶手動解決沖突。 Sampson 決定保用 Byron 建議的函數名,但他使用原來注釋,因為這是他加入的。刪除沖突標記混帳后差異會看起來像這樣。 [sampson@CentOS src]$ git diff 上面的命令會產生以下結果。 diff --cc src/string_operations.c diff --cc src/string_operations.c index 52bec84,163a779..0000000 --- a/src/string_operations.c +++ b/src/string_operations.c @@@ -1,8 -1,17 +1,18 @@@ #include <stdio.h> #include <wchar.h> + wchar_t *my_wstrchr(wchar_t *ws, wchar_t wc) +{ + while (*ws) { + if (*ws == wc) + return ws; + ++ws; + } + return NULL; +} + +/* wide character strlen fucntion */ - size_t my_wc_strlen(const wchar_t *s) + size_t my_wstrlen(const wchar_t *s) { const wchar_t *p = s; Sampson 修改過的文件,他先提交這些更改后,他就可以推送了。 [sampson@CentOS src]$ git commit -a -m 'Resolved conflict' [master 6b1ac36] Resolved conflict [sampson@CentOS src]$ git pull origin wchar_support. Sampson 已經解決沖突,現在推送操作將成功。
                  <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>

                              哎呀哎呀视频在线观看