代码之家  ›  专栏  ›  技术社区  ›  DodgyCodeException

无crlf转换的Git提交[重复]

git
  •  0
  • DodgyCodeException  · 技术社区  · 7 年前

    我想覆盖某些Git配置选项(在我的例子中 http.proxy

    0 回复  |  直到 7 年前
        1
  •  56
  •   bereal    13 年前

    是的,你可以通过 -c

    git -c http.proxy=someproxy clone https://github.com/user/repo.git
    
        2
  •  10
  •   VonC    11 年前

    注意,这里有一个关于覆盖(使用命令 git -c )配置:

    无法将配置设置为空字符串( git -c http.proxy= foo.bar= ),直到 git 2.1.2 (2014年9月30日),以及 commit a789ca7 Junio C Hamano ( gitster )

    吉特-c

    在配置文件中,可以执行以下操作:

    [foo]
    bar
    

    转动“ foo.bar “布尔标志打开,您可以执行以下操作:

    [foo]
    bar=
    

    设置“ 美食酒吧
    但是,git的“ -c “参数同时处理:

    git -c foo.bar
    

    git -c foo.bar=
    


    此修补程序使后一个表单能够执行此操作。

        3
  •  0
  •   VonC    6 年前

    正如git2.23(2019年第3季度)中所述,但在此之前已经可以使用,您可以重写Git配置选项的另一个地方是。。。 git别名

    commit 459842e , commit 01991ce (2019年6月5日)签署人 Denton Liu ( Denton-L )
    (合并方 Junio C Hamano -- gitster -- 在里面 commit 71221f2

    config/alias.txt :接受非命令首字的文档别名

    可以看到以非命令首字开头的别名,例如 loud-rebase = -c commit.verbose=true rebase ,是允许的。
    但是,这对于用户来说并不明显,因为别名实例通常以命令开头。

    记录别名可以以非命令首字开头的事实,以便用户能够发现这是一个功能。

    The documentation

    请注意,别名的第一个单词不一定必须是 命令。 它可以是将传递到 git .

    尤其是,当与一起使用时,这非常有用 -c 通过一次性配置或 -p 强制分页。

    响亮的鞋底=-ccommit.verbose=真回扣 可以这样定义 git loud-rebase git -c commit.verbose=true rebase .

    ps = -p status git ps 将对的输出分页 git status

    例如,我定义:

    vonc@vonvb:~/gits/src/git$ git config alias.loud-commit "-c commit.verbose=true commit"
    vonc@vonvb:~/gits/src/git$ git loud-commit -a
    

    这给了我:

    git loud commit

    git commit -a .

    别名不需要以开头 !git 调用shell命令 .
    它可以直接从 吉特 命令选项,比如 -c .