Git分支名称大写

4
在特定的项目中,“feature”一词被转换为大写字母。
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
在不区分大小写的文件系统中(例如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 中查看您的存储库的大小写。


谢谢,我看一下 find .git/refs/heads,发现我的第一个分支“feature”是“FEATURE”。 - Bruno Luiz K.
1
我不明白这如何回答问题...分支前缀被转换为大写。 - evolutionxbox
1
这不是问题。这是git UI/实现的缺陷之一。现在这个缺陷被更好地理解了,将来可以绕过它。例如,通过不使用不同大小写的“分支文件夹”来避免这种情况。 - Adam
1
运行得很好。更改文件夹名称就解决了。你救了我<3。 - dungmidside

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接