简单提交和约定性提交之间的区别是什么?

huangapple go评论54阅读模式
英文:

what is the difference between a simple commit and conventional commit

问题

我是新手使用git,并且正在进行我的项目。我每次都执行以下步骤:

git add .

然后

git commit -m "消息"

带有一条消息,然后我推送,但最近我了解到了"commit conventional",但我不理解它们之间的区别是什么?你能解释给我吗?我的意思是,我正在寻找一种方法,让我的朋友能够得知我在我的项目上做了什么,提前感谢。

英文:

I'm new with the git and i'm working on my own project and what i do every time is

git add .

then

git commit -m "message "

with a message and then i push but recently i learnt about commit conventional but i didn't understand what is the difference about them ? can u explain it to me I mean i search for method that allows my friend to be updated and understand what i do on my project thanks on advance

答案1

得分: 4

Conventional Commits 是纯粹的提交消息结构的约定。

如果只是你和一些朋友,它可能不是非常重要(至少不比实际消息文本重要),但在更大的项目以及有大量公众关注和/或自动化工具参与的项目中,它是一种统一的方式来结构化经常提供的信息。

例如,如果你的提交消息通常是这样的:

添加选项以frobnicate quux。

那么按照 Conventional Commits 的规则写的“等效”提交消息会看起来像这样:

feat(quux): 添加选项以frobnicate quux。

Refs: FOO-123

(其中 FOO-123 将是对某个票务系统的引用)。

正如你所看到的,它并没有根本不同,它只是提供了一个固定的结构和一些约定。

在我看来,只要你不严格使用票务(错误/问题/...)来跟踪你的所有工作,你可能不需要担心这个。

英文:

Conventional Commits is purely a convention of how to structure the commit message.

It's probably not hugely important if it's just you and a few friends (at least not more important than the actual message text), but in bigger projects and projects with lots of public interest and/or automated tools working on them it's a unified way to structure frequently-provided information.

For example if your commit message would usually be something like

Add option to frobnicate the quux.

Then the "equivalent" commit message written to the rules of a Conventional Commits would look something like this:

feat(quux): Add option to frobnicate the quux.

Refs: FOO-123

(Where FOO-123 would be a reference to some ticketing system).

As you see it's not fundamentally different, it just provides a fixed structure and some conventions.

In my opinion as long as you don't strictly use tickets (bugs/issues/...) to track all your work, you're probably not at a level where you need to care about this.

huangapple
  • 本文由 发表于 2023年3月8日 16:53:08
  • 转载请务必保留本文链接:https://go.coder-hub.com/75671005.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定