参数一个破折号和两个破折号上的git差异 [英] git difference on parameter one dash and two dashes
问题描述
在git中,当我指定一个参数时,即
git log -n 5
使用一个参数与一个破折号 - 而不是两个破折号的区别是什么 -
git log --author =Larvae
不是真正的git特定。许多程序使用以下约定:
- 单字母参数:一个短划线
- 多字母参数:两个破折号
/ b>
这很方便,因为它允许您用一个短划线一次性指定许多单字母参数您需要的参数字母:
ls -al
相当于ls -a -l </ code>。
通常,单字母参数是最常用的参数,可以使用两个破折号来表示更长的等效参数:例如
git add -v
和
git add --verbose
表示相同。in git when I specify a parameter, ie
git log -n 5
what is the difference of using a parameter with one dash "-" as opposed to two dashes "--"
git log --author="Larvae"
解决方案That's not really git specific. Many programs use the following convention:
- single-letter parameter: one dash
- multi-letter parameter: two dashes
This is handy, because it allows you to specify many single-letter parmeters at once with a single dash and all letters of the parameters you need:
ls -al
is equivalent tols -a -l
.Often, one-letter parameters are the most used ones and can have a longer equivalent with two dashes: for example
git add -v
andgit add --verbose
mean the same.这篇关于参数一个破折号和两个破折号上的git差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!