You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Improve branch renaming UX on Windows (Case-only changes require double rename) #21320
I'm opening this issue to bring attention to a specific usability hurdle regarding branch renaming on Windows, which I previously mentioned in a comment here: #21287 (comment).
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
exportasyncfunctionrenameBranch(repository: Repository,branch: Branch,newName: string): Promise<void>{constoldName=branch.nameWithoutRemoteconstisCaseInsensitiveRename=oldName.toLowerCase()===newName.toLowerCase()&&oldName!==newNameconstisWindows=process.platform==='win32'// If Windows and case-only rename, use the two-step rename processif(isWindows&&isCaseInsensitiveRename){consttempName=`${oldName}-temp-${Date.now()}`// Step 1: Rename to temp nameawaitgit(['branch','-m',oldName,tempName],repository.path,'renameBranch-step1')// Step 2: Rename to target nameawaitgit(['branch','-m',tempName,newName],repository.path,'renameBranch-step2')return}// Default behavior for other casesawaitgit(['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.
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 wantedIssues 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.
This is an issue on macOS (on the default file system at least) as well. You wouldn't even need to do the temp branch name, you could just pass -M instead of -m to force the change. The problem is knowing for certain that the file system is case insensitive at the location.
Like, on Windows (NTFS) you can set a folder to be case sensitive. To be super certain we're not overwriting a branch that differs we'd have to check that they point to the same object as well.
Thanks for the quick response and the fix! I see that using the -M flag is a much cleaner approach than what I proposed.
As a frequent user of GitHub Desktop, I was really hoping to have the honor of contributing to the codebase myself, but I'm just glad this UX hurdle is being resolved so fast. I will definitely look for other opportunities to contribute in the future!
Activity
github-actions commentedon Nov 28, 2025
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 wantedIssues 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.
niik commentedon Nov 28, 2025
This is an issue on macOS (on the default file system at least) as well. You wouldn't even need to do the temp branch name, you could just pass
-Minstead of-mto force the change. The problem is knowing for certain that the file system is case insensitive at the location.Like, on Windows (NTFS) you can set a folder to be case sensitive. To be super certain we're not overwriting a branch that differs we'd have to check that they point to the same object as well.
niik commentedon Nov 28, 2025
Opened #21323 to address this
hi2242 commentedon Nov 28, 2025
@niik
Thanks for the quick response and the fix! I see that using the -M flag is a much cleaner approach than what I proposed.
As a frequent user of GitHub Desktop, I was really hoping to have the honor of contributing to the codebase myself, but I'm just glad this UX hurdle is being resolved so fast. I will definitely look for other opportunities to contribute in the future!