代码之家  ›  专栏  ›  技术社区  ›  Bruno Luiz K.

分支的Git大写名称

  •  1
  • Bruno Luiz K.  · 技术社区  · 6 年前

    在特定的项目中,“功能”一词是大写的。

    For example:
    git checkout -b "feature/#123123-test"
    
    the name of branch will:
    FEATURE/#123123-teste
    
    if I put:
    git checkout -b "otherthing/#123123-test"
    
    will:
    otherthing/#123123-test
    

    GITCONFIG:

    [filter "lfs"]
        smudge = git-lfs smudge -- %f
        process = git-lfs filter-process
        required = true
        clean = git-lfs clean -- %f
    [user]
        name = Bruno
        email = *******@******.com.br
    

    有人知道这里发生了什么吗?

    1 回复  |  直到 6 年前
        1
  •  1
  •   Adam    6 年前

    在不区分大小写的文件系统(如Windows)上;

    $ git commit --allow-empty -m "Init."
    [master (root-commit) 69082bb] Init.
    
    $ git checkout -b FEATURE/first
    Switched to a new branch 'FEATURE/first'
    
    $ git checkout -b feature/second
    Switched to a new branch 'feature/second'
    
    $ git branch
     FEATURE/first
     FEATURE/second
     master
    

    您的分支存储为包含它们指向的提交哈希的文件和目录。当您创建一个“分支文件夹”时,它只被创建一次,并且始终具有该大小写。

    看一看 .git/refs/heads 看看你的回购协议。