Git 分支名称 - 区分大小写还是不区分大小写? [英] Git branch name - case sensitive or insensitive?

查看:133
本文介绍了Git 分支名称 - 区分大小写还是不区分大小写?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一个新的 git 用户,最近收到了一个过时的 git 存储库来照顾.

I am a new git user and recently been handed with an out of date git repository to look after.

这是原始状态(由 git show-branch 输出):

This is the original state ( output by git show-branch):

! [cr232] CR 232 Release
        * [dev] Style Changes
---------------
        *   [dev] Style Changes
        *   [dev^] SMS 5.4
        *   [dev~2] Logo Change
        *   [dev~3] SMS 5.3
        *   [dev~4] SMS 5.2
        *   [dev~5] SIT R-0.3.3 EDW SMS Layers
        *   [dev~6] SIT Release R 0.3.0
       +*   [cr232] CR 232 Release
       +*   [cr232^] Dashboard Fix
       +*   [cr232~2] Release for system testing

请注意,此时有一个名为dev"的分支.请注意,突出显示有几个对 dev 的引用(即 dev、dev^、dev~2 等).

Note that there is a branch called ‘dev’ at this point. Note that highlighted there are several references to dev (i.e. dev, dev^, dev~2 etc).

为了我的开发目的,我试图想出一个名为DEV"的分支,所有资本.

For my development purpose, I was trying to come up with a branch called ‘DEV’, all capital.

所以我继续创建新分支(git branch DEV),现在运行 git show-branch –date-order:

So I went ahead and create new branch (git branch DEV) and now running git show-branch –date-order:

! [DEV] Style Changes
    ! [cr232] CR 232 Release
        * [dev] Style Changes
---------------
        *   [DEV] Style Changes
        *   [DEV^] SMS 5.4
        *   [DEV~2] Logo Change
        *   [DEV~3] SMS 5.3
        *   [DEV~4] SMS 5.2
        *   [DEV~5] SIT R-0.3.3 EDW SMS Layers
        *   [DEV~6] SIT Release R 0.3.0
       +*   [cr232] CR 232 Release
       +*   [cr232^] Dashboard Fix
       +*   [cr232~2] Release for system testing

请注意,dev 和 DEV 都列为分支.另请注意,第 5 行对 dev 的引用现在已更改为 DEV(即 DEV、DEV^、DEV~2 等).

Note that both dev and DEV are listed as branch. Note also that on the 5th line the references to dev have now changed to DEV (i.e. DEV, DEV^, DEV~2 etc).

第 5 行输出指的是什么?我希望它保持dev"而不是更改为DEV",因为它旁边的描述指的是dev"分支期间旧工作的描述.

What is the 5th line output referring to? I would expect it to remain "dev" instead of being changed to "DEV" as the descriptions next to it refers to the description of old work during "dev" branch.

我试图通过将 DEV 分支名称修改为 DV(运行 git branch –m DEV DV)并显示分支现在看起来像:

I am trying to return back to how it was by modifying the DEV branch name to DV (running git branch –m DEV DV) and showing the branch now look like:

! [DV] Style Changes
    ! [cr232] CR 232 Release
        * [dev] Style Changes
---------------
        *   [DV] Style Changes
        *   [DV^] SMS 5.4
        *   [DV~2] Logo Change
        *   [DV~3] SMS 5.3
        *   [DV~4] SMS 5.2
        *   [DV~5] SIT R-0.3.3 EDW SMS Layers
        *   [DV~6] SIT Release R 0.3.0
       +*   [cr232] CR 232 Release
       +*   [cr232^] Dashboard Fix
       +*   [cr232~2] Release for system testing

请注意,分支现在包括 DV 和 dev.另请注意,第 5 行对 dev 的引用现在已更改为 DV(即 DV、DV^、DV~2 等).

Note that the branch is now including DV and dev. Note also that the 5th line references to dev have now changed to DV (i.e. DV, DV^, DV~2 etc).

有什么办法可以恢复到 DV 参考时的原始状态?git 是否混淆并使用一个类似的分支重命名了我的历史信息,只是大小写不同?

Is there any way to get back to how it was during original state in term of the DV references? Did the git got confused and renamed my historic information with a branch that is similar and only differs by capital case?

请帮助我解决这个问题.谢谢堆

Please assist on how I can fix this. Thanks heaps

推荐答案

所以我继续创建新分支(git branch DEV)

So I went ahead and create new branch (git branch DEV)

当您在分支 dev 上时,您创建了一个新分支 DEV.所以 DEVdev 是指向同一个提交的两个分支.将 DEV 重命名为 DV 后,现在 DVdev 是指向同一个提交的两个分支.

You created a new branch DEV when you were on the branch dev. So DEV and dev are two branches that point to the same commit. After you renamed DEV to DV, now DV and dev are two branches that point to the same commit.

一切都很好.如果你不想 DV 打扰你,你可以运行 git branch -d DV 来删除它.如果你确实想创建一个新的分支,最好遵循一些不会混淆你和其他人的命名规则.

Everything is just fine. If you don't want DV to bother you, you could just run git branch -d DV to remove it. If you indeed want to make a new branch, better to follow some naming rule which cannot confuse you and others.

我从未使用过 git show-branch.git log --oneline --all --graph --decorate=full 绘制清晰的日志图.

I never used git show-branch. git log --oneline --all --graph --decorate=full draws a clear log graph.

这篇关于Git 分支名称 - 区分大小写还是不区分大小写?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆