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

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

问题描述



这是原始状态(由git show-分行):

 ! [cr232] CR 232 Release 
* [dev]风格变化
---------------
* [dev]风格变化
* [dev ^] SMS 5.4
* [dev〜2]徽标更改
* [dev〜3]短信5.3
* [dev〜4]短信5.2
* [dev〜 5] SIT R-0.3.3 EDW SMS层
* [dev〜6] SIT Release R 0.3.0
+ * [cr232] CR 232 Release
+ * [cr232 ^] Dashboard修复
+ * [cr232〜2]发布系统测试

请注意,此时分支称为'dev'。请注意,突出显示有几个引用dev(即dev,dev ^,dev〜2等)。

为了我的开发目的,我试图想出一个所有的资本。所以我继续创建新的分支(git分支DEV),现在运行git show-branch -date-order:

/ p>

 ! [DEV]风格变化
! [cr232] CR 232 Release
* [dev]风格变化
---------------
* [DEV]风格变化
* [DEV ^] SMS 5.4
* [DEV〜2]徽标更改
* [DEV〜3]短信5.3
* [DEV〜4]短信5.2
* [DEV〜 5] SIT R-0.3.3 EDW SMS层
* [DEV〜6] SIT Release R 0.3.0
+ * [cr232] CR 232 Release
+ * [cr232 ^] Dashboard修复
+ * [cr232〜2]释放系统测试

请注意,dev和DEV被列为分支。请注意,在第5行上,对dev的引用现在已经更改为DEV(即DEV,DEV ^,DEV〜2等)。

什么是第5行输出指的是?我希望它保持开发而不是被改为开发,因为旁边的描述指的是在开发分支期间旧作品的描述。



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

 ! [DV]风格变化
! [cr232] CR 232 Release
* [dev]风格变化
---------------
* [DV]风格变化
* [DV ^] SMS 5.4
* [DV〜2]徽标变化
* [DV〜3]短信5.3
* [DV〜4]短信5.2
* [DV〜 5] SIT R-0.3.3 EDW SMS层
* [DV〜6] SIT Release R 0.3.0
+ * [cr232] CR 232 Release
+ * [cr232 ^] Dashboard修复
+ * [cr232〜2]释放系统测试

请注意,分支是现在包括DV和dev。请注意,第五行对dev的引用现在已经变成了DV(即DV,DV ^,DV〜2等)。

有什么办法可以回到就DV参考而言,原始状态如何? git是否会被混淆,并将其历史信息重新命名为类似的分支,并且只有大写字母才会有所不同?

请协助我解决这个问题。感谢堆

解决方案


因此,我继续创建新分支(git branch DEV) >

您在分支 DEV >开发。因此, DEV dev 是指向相同提交的两个分支。将 DEV 重命名为 DV 后,现在 DV dev 是指向相同提交的两个分支。



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



我从来没有使用 git show-分支 git log --oneline --all --graph --decorate = full 绘制清晰的日志图形。


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

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

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).

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

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

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).

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.

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

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).

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

解决方案

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

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.

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

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

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

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