【问题标题】:Case sensitive branch names on GitGit 上区分大小写的分支名称
【发布时间】:2016-05-15 07:13:49
【问题描述】:

我有分支叫:

Stuff/myfirstbranch
Stuff/mysecondbranch

我还有另一个分支叫:

stuff/mythirdbranch
stuff/myfourthbranch

注意“s”的大小写。

我想将大写的 S 重命名为 s。我该如何做这件事并将更改推送到我的 git 服务器

【问题讨论】:

    标签: git version-control branch rename


    【解决方案1】:

    首先,确保您与遥控器同步。那么:

    # rename branch locally:
    git branch -m Stuff/myfirstbranch stuff/myfirstbranch
    
    # push new branch to remote:
    git push origin stuff/myfirstbranch
    
    # delete old branch on the remote:
    git push origin :Stuff/myfirstbranch
    

    【讨论】:

    • 当我尝试运行 git branch -m 它说“致命:一个名为 stuff/myfirstbranch 的分支已经存在”
    • 尝试先将其重命名为临时分支,然后将该临时分支重命名为 stuff/myfirstbranch。
    • 可行,但推送给出了“stuff/myfirstbranch cannot be reolved to branch”
    猜你喜欢
    • 2016-11-24
    • 2012-02-12
    • 1970-01-01
    • 2017-02-04
    • 2014-02-17
    • 1970-01-01
    • 2012-07-03
    • 1970-01-01
    • 2017-07-04
    相关资源
    最近更新 更多