git 设置默认提交分支_如何设置默认的提交消息

git 设置默认提交分支

Having a default commit message is really useful for a number of reasons:

出于多种原因,拥有默认的提交消息确实很有用:

  • It can formalize your commit messages

    它可以使您的提交消息形式化
  • It serves as a good reminder for the information you should add to your commit message, like issue number

    它可以很好地提醒您应添加到提交消息中的信息,例如发行号
  • If you set it to "Drunk AF, don't accept this"

    如果将其设置为“醉酒AF,请不要接受”

To set a default commit message on your local machine, start by executing the following from command line:

要在本地计算机上设置默认提交消息,请从命令行执行以下命令开始:

git config --global commit.template ~/.gitmessage

This tells your local git config to pull the text from ~/.gitmessage as the default commit message. You could set the text to something like:

这告诉您本地的git配置将~/.gitmessage的文本作为默认提交消息。 您可以将文本设置为:

Fix Issue #{number}: {description}

R+: {reviewer}

Of course, if you set your commit message via git commit -m {description}, the default will not be used, so it's a win-win!

当然,如果您通过git commit -m {description}设置提交消息,则不会使用默认值,因此是双赢的!

翻译自: https://davidwalsh.name/default-commit-message

git 设置默认提交分支

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值