Skip to content

Unable to rename branch when changing only letter case on Windows (Case Insensitivity) #21287

Closed

Description

@hi2242

The problem

I encountered an issue where GitHub Desktop fails to rename a branch when the change involves only letter case modifications on Windows.

For example, when I tried to rename a branch from feat/be/tomorrow-service to feat/BE/tomorrow-service, GitHub Desktop treated them as the same branch name due to the case-insensitivity of the Windows file system. Currently, to achieve this, I have to manually rename the branch to an intermediate name (e.g. temp-name) and then rename it again to the desired case-sensitive name. This process is cumbersome and unintuitive for users.

Release version

Version 3.5.4 (x64)

Operating system

Window 11 (x64)

Steps to reproduce the behavior

  1. Create a branch named feat/be/test (lowercase).

  2. Right-click the branch and select Rename...

  3. Change the name to feat/BE/test (uppercase) and attempt to save.

  4. Observe that GitHub Desktop either prevents the action (saying the branch already exists) or fails to apply the case change locally/remotely without a workaround.

Log files

No response

Screenshots

Image

Additional context

  • Expected behavior : GitHub Desktop should intelligently handle case-only renames on Windows. Ideally, it should automatically perform the necessary intermediate renaming steps in the background so the user can simply rename feat/be/... to feat/BE/... in one go.
  • Contribution
    • I have been using GitHub Desktop extensively and find it incredibly convenient. As a loyal user, I would love to directly contribute to this project, as it would be a valuable and meaningful experience for me. I believe improving this logic will enhance the user experience for Windows users.

    • Could you please assign this issue to me? I am willing to investigate the codebase and submit a Pull Request to implement the fix.

Activity

  1. added
    triage
    on Nov 20, 2025
  2. added and removed
    triage
    on Nov 21, 2025
  3. github-actions commented on Nov 21, 2025

    @github-actions
    Contributor

    Thank you for your issue! We have categorized it as a feature request, and it has been added to our backlog. In doing so, we are not committing to implementing this feature at this time, but, we will consider it for future releases based on community feedback and our own product roadmap.

    Unless you see the help wanted Issues marked as ideal for external contributors label, we are not currently looking for external contributions for this feature.

    If you come across this issue and would like to see it implemented, please add a thumbs up! This will help us prioritize the feature. Please only comment if you have additional information or viewpoints to contribute.

  4. hi2242 commented on Nov 21, 2025

    @hi2242
    ContributorAuthor

    @sergiou87 Thank you for reviewing this issue and adding it to the backlog.

    I understand that you are not actively looking for external contributions for this feature at the moment. However, I have already investigated the codebase and identified a clean, low-risk solution that I would love to implement if permitted.

    Proposed Solution

    I found that the logic can be handled within app/src/lib/git/branch.ts inside the renameBranch function.
    Since Windows is case-insensitive, we can detect if the OS is win32 and if the rename is only a case change. In that specific scenario, we can implement a two-step rename process (e.g. oldName -> tempName -> newName) to force the filesystem to register the change.

    Here is the rough implementation idea:

    Click to view the code snippet
    export async function renameBranch(repository: Repository, branch: Branch, newName: string): Promise<void> {
      const oldName = branch.nameWithoutRemote
      const isCaseInsensitiveRename = oldName.toLowerCase() === newName.toLowerCase() && oldName !== newName
      const isWindows = process.platform === 'win32'
    
      // If Windows and case-only rename, use the two-step rename process
      if (isWindows && isCaseInsensitiveRename) {
        const tempName = `${oldName}-temp-${Date.now()}`
        
        // Step 1: Rename to temp name
        await git(['branch', '-m', oldName, tempName], repository.path, 'renameBranch-step1')
        
        // Step 2: Rename to target name
        await git(['branch', '-m', tempName, newName], repository.path, 'renameBranch-step2')
        
        return
      }
    
      // Default behavior for other cases
      await git(['branch', '-m', oldName, newName], repository.path, 'renameBranch')
    }

    This approach isolates the fix to the Git operation layer without requiring complex UI changes.

    Since I have a clear implementation plan ready that aligns with the project's architecture, would you be open to adding the help-wanted label to this issue? I am eager to submit a PR following your contribution guidelines to help improve the Windows user experience.

  5. SisypheOvO commented on Jan 29, 2026

    @SisypheOvO

    @hi2242 is the issue fixed on your side? I got the same problem just now with Version 3.5.4 (x64) on Windows 11 (which is the newest version)

  6. hi2242 commented on Jan 29, 2026

    @hi2242
    ContributorAuthor

    @SisypheOvO

    Hello.

    The issue can be found here: #21320 and has already been fixed, but it seems the issue is recurring because a new update version hasn't been officially released.

    https://github.com/desktop/desktop/releases/tag/release-3.5.5-beta1 This is currently in beta, but we expect to see updates in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions