gpt4 book ai didi

Git (MacOS) 区分大小写的覆盖问题

转载 作者:行者123 更新时间:2023-12-03 18:38:04 25 4
gpt4 key购买 nike

我正在一个由混合 Linux/MacOS 开发人员组成的团队工作。 MacOS 不区分大小写,而 Linux 区分大小写。我有以下问题:

我的(MacOS)机器:

$ git checkout master
$ echo hi > MyModule.js
$ git commit -a -m 'Create MyModule.js'
$ git push origin master
$ git checkout -b other-work
... (do work)

同事的 (Linux) 机器
$ git checkout master
$ git pull
$ git mv MyModule.js myModule.js
$ git commit -m 'Rename MyModule.js to myModule.js'
$ git push

我的 (MacOS) 机器
# Currently on branch other-work
$ git fetch
$ git checkout origin/master
error: The following untracked working tree files would be overwritten by checkout:
MyModule.js
# In order to resolve the issue, I have to resort to hackery:
$ rm MyModule.js
$ git checkout origin/master
$ git checkout -- myModule.js # Restore the rm'd file

我真的很想避免所有这些黑客行为。我希望我的 MacOS git 知道文件名的大小写变化,以便我可以在分支之间自由切换。我试过设置 ignorecase将配置值设置为 true 和 false 但这无济于事。

最佳答案

他们是我绕过这是将分区格式化为区分大小写。

这就是我所有开发站点的服务来源。

关于Git (MacOS) 区分大小写的覆盖问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25575463/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com