当前位置: 首页 > news >正文

商城网站建设最好的公司天津网站策划

商城网站建设最好的公司,天津网站策划,南阳网站制作,盐城做企业网站哪家好Jerry 工作在wchar_support分支。他改变了名称的功能和测试后,他提交他的变化。 [jerryCentOS src]$ git branchmaster * wchar_support [jerryCentOS src]$ git diff上面的命令产生以下结果 diff --git a/src/string_operations.c b/src/string_operations.c index…

Jerry 工作在wchar_support分支。他改变了名称的功能和测试后,他提交他的变化。

[jerry@CentOS src]$ git branchmaster
* wchar_support
[jerry@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;

验证代码后,他提交了他的变化。

[jerry@CentOS src]$ git status -s
M string_operations.c[jerry@CentOS src]$ git add string_operations.c[jerry@CentOS src]$ git commit -m 'Changed function name'
[wchar_support 3789fe8] Changed function name
1 files changed, 1 insertions(+), 1 deletions(-)[jerry@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

在主分支进行更改

同时在主分支Tom 也改变了名称相同的功能,并将其更改到主分支。

[tom@CentOS src]$ git branch
* master
[tom@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;

验证差异后,他提交了他的变化。

[tom@CentOS src]$ git status -s
M string_operations.c[tom@CentOS src]$ git add string_operations.c[tom@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(-)[tom@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 函数在分支Jerry 实现 wchar_support宽字符字符串。经过测试,他提交和推送其变化 wchar_support 分支。

[jerry@CentOS src]$ git branch
master
* wchar_support
[jerry@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;

验证变化后,他提交他的变化。

[jerry@CentOS src]$ git status -s
M string_operations.c[jerry@CentOS src]$ git add string_operations.c[jerry@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(-)[jerry@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

对付冲突

Tom想看,Jerry 在他的私人分支做什么?这就是为什么他试图从wchar_support分支把最新的修改,但Git 放弃操作在得到错误消息后。

[tom@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
Automatic merge failed; fix conflicts and then commit the result.

解决冲突

从错误消息很显然知道,是有冲突的在src/string_operations.c。他运行 git diff 命令查看进一步的细节。

[tom@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;

由于Tom 和Jerry 在相同的功能更改的名称,Git不知道如何去做,因此这就是为什么它要求用户手动解决冲突。

Tom 决定保用 Jerry 建议的函数名,但他使用原来注释,因为这是他加入的。删除冲突标记混帐后差异会看起来像这样。

[tom@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;

Tom 修改过的文件,他先提交这些更改后,他就可以推送了。

[tom@CentOS src]$ git commit -a -m 'Resolved conflict'
[master 6b1ac36] Resolved conflict[tom@CentOS src]$ git push origin wchar_support.

Tom 已经解决冲突,现在推送操作将成功。


http://www.yiibai.com/git/git_handling_conflicts.html


http://www.lbrq.cn/news/2524663.html

相关文章:

  • 产品发布网站的装饰怎么做店铺推广渠道有哪些
  • 微信小程序推广赚佣金河南自助建站seo公司
  • 360做网站经常打骚扰电话百度关键词推广网站
  • 珠宝网站建设平台分析报告怎么注册一个网站
  • 马连洼网站建设谷歌ads
  • php动态网站开发 项目教程国际最新十大新闻事件
  • 百度生成手机网站站内优化主要从哪些方面进行
  • 个人网站模板源码论坛排名
  • 手机端网站如何做排名哪家竞价托管专业
  • 吉林省党风廉政建设官方网站重庆做优化的网络公司
  • 贵溪市城乡建设局网站地推推广平台
  • 西安软件开发公司百度seo软件曝光行者seo
  • 做性的网站有哪些哈尔滨seo整站优化
  • 免费网站建设制作视频音乐接单推广app平台
  • 网上学影视后期靠谱吗王通seo教程
  • 可以做设计兼职的网站有哪些工作可免费投放广告的平台
  • 政府网站策划书站长之家seo综合
  • 怎么做游戏和网站漏洞网络营销策划
  • 网站建设不力 被问责游戏代理加盟平台
  • 通州重庆网站建设免费大数据分析网站
  • 网站制作工资企业seo排名有 名
  • 网站设计外包合同百度搜索推广收费标准
  • 电子商务网站建设属性2022十大热点事件及评析
  • 乐清做网站建设公司哪家好seo搜索引擎是什么
  • 创造力网站设计网络推销平台有哪些
  • 嘉定房产网站建设全网推广引流黑科技
  • 做搜狗网站关键词排名网络营销的盈利模式
  • 嘉兴建设网站百度一下官网网址
  • 网站做系统叫什么软件吗佛山网站建设排名
  • 图库 网站 源码各大网站收录入口
  • STM32F1 Flash的操作
  • 网络的学习 2 Socket
  • 爬虫自动化:一文掌握 PyAutoGUI 的详细使用
  • vue3组件通信的几种方法,详解
  • buuctf_crypto26-30
  • thingsboard 自定义动作JS编程