git版本管理系列(九)

git版本管理系列(八)

推送冲突的解决

创建新分支

nelsen-mac:learngit mac$ git checkout -b f1
Switched to a new branch 'f1'

修改文件readme.md,并且commit 到本地仓库

nelsen-mac:learngit mac$ git add readme.md 
nelsen-mac:learngit mac$ git commit -m'create a conflict'

切换到master分支,修改readme.md文件

nelsen-mac:learngit mac$ git checkout master

然后提交修改 

nelsen-mac:learngit mac$ git commit -m'conflict is coming'

 合并f1分支,提示我们发生了冲突

nelsen-mac:learngit mac$ git merge f1
Auto-merging readme.md
CONFLICT (content): Merge conflict in readme.md
Automatic merge failed; fix conflicts and then commit the result.

 

<<<<<<< HEAD

我是来解决冲突的哦

=======

???????? 这次是我来解决冲突的

>>>>>>> f1

修改为:

???????? 这次是我来解决冲突的

 然后再合并提交

nelsen-mac:learngit mac$ git add readme.md 
nelsen-mac:learngit mac$ git commit -m'now is ok'
[master 4bdd120] now is ok

用 git log --graph --pretty=oneline --abbrev-commit 查看分支合并情况

然后再删除分支 git branch -d f1 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

风清云淡_A

觉得有帮助的话可以给点鼓励

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值