Skip to content

Commit 302cc11

Browse files
Diekengitster
authored andcommitted
Documentation on --git-dir and --work-tree
1 parent 0104ca0 commit 302cc11

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

Documentation/config.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,13 @@ core.worktree::
234234
used in combination with repositories found automatically in
235235
a .git directory (i.e. $GIT_DIR is not set).
236236
This can be overridden by the GIT_WORK_TREE environment
237-
variable and the '--work-tree' command line option.
237+
variable and the '--work-tree' command line option. It can be
238+
a absolute path or relative path to the directory specified by
239+
--git-dir or GIT_DIR.
240+
Note: If --git-dir or GIT_DIR are specified but none of
241+
--work-tree, GIT_WORK_TREE and core.worktree is specified,
242+
the current working directory is regarded as the top directory
243+
of your working tree.
238244

239245
core.logAllRefUpdates::
240246
Enable the reflog. Updates to a ref <ref> is logged to the file

Documentation/git.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,21 @@ help ...'.
143143

144144
--git-dir=<path>::
145145
Set the path to the repository. This can also be controlled by
146-
setting the GIT_DIR environment variable.
146+
setting the GIT_DIR environment variable. It can be an absolute
147+
path or relative path to current working directory.
147148

148149
--work-tree=<path>::
149150
Set the path to the working tree. The value will not be
150151
used in combination with repositories found automatically in
151152
a .git directory (i.e. $GIT_DIR is not set).
152153
This can also be controlled by setting the GIT_WORK_TREE
153154
environment variable and the core.worktree configuration
154-
variable.
155+
variable. It can be an absolute path or relative path to
156+
the directory specified by --git-dir or GIT_DIR.
157+
Note: If --git-dir or GIT_DIR are specified but none of
158+
--work-tree, GIT_WORK_TREE and core.worktree is specified,
159+
the current working directory is regarded as the top directory
160+
of your working tree.
155161

156162
--bare::
157163
Treat the repository as a bare repository. If GIT_DIR

0 commit comments

Comments
 (0)