Customizable Git Config Settings in GitHub Desktop #19526
Description
The feature request
Currently, GitHub Desktop does not provide a user-friendly way to configure certain advanced Git settings, such as longpaths = true
, directly within the app's UI. Users must manually edit their .gitconfig
file or use the command line to adjust these settings. This can be cumbersome, especially for users unfamiliar with Git’s configuration files or those who prefer a more integrated experience within GitHub Desktop.
Additionally, any changes made manually to the .gitconfig
file are only specific to the version of GitHub Desktop where they were edited. When users update to a new version of the app, these custom configurations are not automatically ported over, forcing users to reapply their settings after each update. This creates friction in the user experience, especially for those who rely on specific configurations like core.longpaths = true
for their projects. Please see for example: https://stackoverflow.com/questions/51572079/github-cloning-gives-file-name-too-long
Proposed solution
Introduce a new section in the GitHub Desktop settings UI that allows users to modify and save specific Git configuration options (e.g., longpaths = true
). These settings should be stored persistently across sessions and versions of the app. This would make it easier for users to manage advanced Git configurations without leaving the app or editing configuration files manually.
Key Features:
- Customizable Git Configurations: Add an option in the settings menu (under the "Git" tab) where users can modify common Git settings such as
core.longpaths
,merge.conflictstyle
, etc. - Persistent Storage: Ensure that these settings are saved and carried over when updating or reinstalling GitHub Desktop.
- User-Friendly Interface: Provide a simple form or toggle switches for enabling/disabling specific configurations (e.g., a checkbox for
longpaths = true
). - Advanced Options: Allow users to add custom key-value pairs for less common configurations if needed.
Example Use Case:
A user working on a project with deeply nested directories encounters issues with Windows' path length limitations. They want to set core.longpaths = true
to avoid errors but prefer not to manually edit their .gitconfig
file. With this feature, they could simply toggle this option in the GitHub Desktop UI, making their workflow smoother and more efficient.
Benefits:
- Improves usability for non-technical users who may not be comfortable editing config files.
- Enhances integration by allowing more advanced Git operations directly within the app.
- Saves time by eliminating the need to switch between the command line and GitHub Desktop for configuration changes.
Additional context
This feature could be implemented similarly to how other settings (e.g., editor preferences or theme selection) are managed in GitHub Desktop. It would fit naturally under the existing "Git" section of the preferences menu, where users can already configure basic settings like author name and email.
This request aligns with other customization features like selecting a custom path for the Git executable, which has been previously discussed in issues such as #14222. Expanding this customization to include .gitconfig
options would further enhance the flexibility of GitHub Desktop for power users while maintaining ease of use for beginners.