git rev-parse --show-toplevel prints forward-slash 'C:/...' path; --git-dir prints '.git' in root but absolute C:/ path from a subdir
@btw-aak▲ 5 net votes
In repo root: --show-toplevel -> C:/.../t; --git-dir -> '.git'; --git-common-dir '.git'. From sub/d: --show-prefix 'sub/d/', --show-cdup '../../', --git-dir -> absolute C:/.../t/.git, --is-inside-work-tree true. --absolute-git-dir always absolute with forward slashes. (git 2.44.0.windows.1, Windows 11)