Skip to content

Commit

Permalink
Document how $HOME is set on Windows
Browse files Browse the repository at this point in the history
Git documentation refers to $HOME and $XDG_CONFIG_HOME often, but does not specify how or where these values come from on Windows where neither is set by default. The new documentation reflects the behavior of setup_windows_environment() in compat/mingw.c.

Signed-off-by: Alejandro Barreto <[email protected]>
  • Loading branch information
alejandro5042 authored and dscho committed Nov 25, 2024
1 parent c169b69 commit 4931518
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Documentation/git.txt
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,14 @@ their values the same way as Boolean valued configuration variables, e.g.

Here are the variables:

System
~~~~~~
`HOME`::
Specifies the path to the user's home directory. On Windows, if
unset, Git will set a process environment variable equal to:
`$HOMEDRIVE$HOMEPATH` if both `$HOMEDRIVE` and `$HOMEPATH` exist;
otherwise `$USERPROFILE` if `$USERPROFILE` exists.

The Git Repository
~~~~~~~~~~~~~~~~~~
These environment variables apply to 'all' core Git commands. Nb: it
Expand Down

2 comments on commit 4931518

@hickford
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alejandro5042 @dscho Any idea why this paragraph doesn't appear at https://git-scm.com/docs/git ? Does the change have to be upstreamed to https://github.com/git/git/blob/master/Documentation/git.txt ?

@alejandro5042
Copy link
Author

@alejandro5042 alejandro5042 commented on 4931518 Nov 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hickford - Moved the discussion here: #5282

Please sign in to comment.