如何配置Mercurial Hg默认不保留备份? [英] How does one configure mercurial hg to not retain backups by default?
问题描述
我从不使用那些.orig文件,并且我讨厌手动清理它们.有没有一种方法可以将hg revert
配置为默认使用--no-backups
选项?我在 Mercurial手册
I never use those .orig files, and I hate cleaning them up manually. Is there a way to configure hg revert
to use the --no-backups
option by default? I can't find it in the Mercurial manual
可以使用shell别名,但这不是必需的.
Using a shell alias is possible but isn't desirable.
推荐答案
您可以在配置文件中创建别名.
You can create an alias in your config file.
有关配置文件的更多详细信息,位于 http://www.selenic.com/mercurial /hgrc.5.html
More details on the config file at http://www.selenic.com/mercurial/hgrc.5.html
请自己阅读本手册,自上次阅读以来,它似乎有所更改.我本来建议使用默认值,但似乎已弃用.建议使用别名.
Read the manual myself, and it looks like its changed somewhat since the last time I read it. I was going to suggest using defaults, but it appears that has been deprecated. The recommendation is to use aliases.
似乎别名可以覆盖内置命令,但显然他们不建议这样做.
It appears an alias CAN override a built-in command, but obviously they don't recommend it.
所以,你可以做
[alias]
revert = revert --no-backup
但是建议是为自己创建一个新命令
but the recommendation would be to create a new command for yourself
这篇关于如何配置Mercurial Hg默认不保留备份?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!