Skip to content

Instantly share code, notes, and snippets.

@jarek-przygodzki
Last active July 10, 2023 15:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jarek-przygodzki/48acaacca7f64dd4e61f31a02b423002 to your computer and use it in GitHub Desktop.
Save jarek-przygodzki/48acaacca7f64dd4e61f31a02b423002 to your computer and use it in GitHub Desktop.
How core.longpaths works in Git

I've recently looked into how core.longpaths Git options works and how it's related to Enable Win32 long paths Windows option. Turns out they are not related, and longpaths is both clever and hacky.

Many Windows wide char APIs support longer than MAX_PATH paths through the file namespace prefix (\\?\ or \\?\UNC\) followed by an absolute path. When long paths support is enabled via 'core.longpaths' option, handle_long_path function expands long paths using the '\?' file namespace prefix. See this commit message for detailed explantion.

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