git是否返回特定的返回错误代码? [英] Does git return specific return error codes?

查看:76
本文介绍了git是否返回特定的返回错误代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

像合并错误或重新定义错误一样。它有一个唯一的错误代码吗?

解决方案

我设置了一个测试失败。这是我得到的:

  $ git merge newbranch 
自动合并test.txt
CONFLICT(内容):在test.txt中合并冲突
自动合并失败;修复冲突,然后提交结果。

$ echo $?
1

Git返回 0 当它正确地合并时,如预期那样。


Like merging errors, or rebase errors. Does it have a unique error code?

解决方案

I set-up a test to fail. This is what I got:

$ git merge newbranch
Auto-merging test.txt
CONFLICT (content): Merge conflict in test.txt
Automatic merge failed; fix conflicts and then commit the result.

$ echo $?
1

Git returns 0 when it merges correctly, as expected.

这篇关于git是否返回特定的返回错误代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆