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

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

问题描述

在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 to ls -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 and git add --verbose mean the same.

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

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