简体   繁体   English

Mac上的Git分支名称

[英]Git branch name on mac

I created the following branch on my MAC machine: DevTasks/dev 我在我的MAC机器上创建了以下分支: DevTasks/dev
Did some stuff and committed. 做了一些事情和承诺。 I had to rename the branch to devTasks/dev . 我不得不将分支重命名为devTasks/dev I am not able to do that. 我无法做到这一点。

When I run 我跑的时候

git branch -m DevTasks/dev devTasks/dev

I received "a branch name devTasks/dev is already exists" 我收到“分支名称devTasks / dev已经存在”

I also removed completely the branch DevTasks/dev and created the new branch devTasks/dev . 我还完全删除了分支DevTasks/dev并创建了新的分支devTasks/dev This also did not help. 这也没有帮助。

Is it possible to rename branch name to the same branch name with capital letters on a Mac? 是否可以在Mac上使用大写字母将分支名称重命名为相同的分支名称?

Considering the case sensitive nature of branches on Mac, the safest workaround would be to: 考虑到Mac上分支的区分大小写的特性 ,最安全的解决方法是:

  • rename DevTasks/dev into devTasks/dev2 DevTasks/dev重命名为devTasks/dev2
  • making sure .git/refs/head/dev no longer exist 确保.git/refs/head/dev不再存在
  • then rename devTasks/dev2 into devTasks/dev 然后将devTasks/dev2重命名为devTasks/dev

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM