参数一个破折号和两个破折号的git差异 [英] git difference on parameter one dash and two dashes

查看:49
本文介绍了参数一个破折号和两个破折号的git差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在git中指定参数时,即

in git when I specify a parameter, ie

git log -n 5

git log -n 5

使用带一个破折号-"和两个破折号--"的参数有什么区别

what is the difference of using a parameter with one dash "-" as opposed to two dashes "--"

git log --author="幼虫"

git log --author="Larvae"

推荐答案

那并不是真正的 git 特定的.许多程序使用以下约定:

That's not really git specific. Many programs use the following convention:

  • 单字母参数:一个破折号
  • 多字母参数:两个破折号

这很方便,因为它允许您使用一个破折号和您需要的参数的所有字母同时指定多个单字母参数:ls -al 等效于 ls-a -l.

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 to ls -a -l.

通常,单字母参数是最常用的参数,并且可以有两个破折号的更长等效项:例如 git add -vgit add --verbose意思是一样的.

Often, one-letter parameters are the most used ones and can have a longer equivalent with two dashes: for example git add -v and git add --verbose mean the same.

这篇关于参数一个破折号和两个破折号的git差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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