Skip to content

Commit 0e29222

Browse files
newrengitster
authored andcommitted
Documentation: call out commands that nuke untracked files/directories
Some commands have traditionally also removed untracked files (or directories) that were in the way of a tracked file we needed. Document these cases. Signed-off-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 94b7f15 commit 0e29222

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

Documentation/git-checkout.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,9 @@ OPTIONS
118118
-f::
119119
--force::
120120
When switching branches, proceed even if the index or the
121-
working tree differs from `HEAD`. This is used to throw away
122-
local changes.
121+
working tree differs from `HEAD`, and even if there are untracked
122+
files in the way. This is used to throw away local changes and
123+
any untracked files or directories that are in the way.
123124
+
124125
When checking out paths from the index, do not fail upon unmerged
125126
entries; instead, unmerged entries are ignored.

Documentation/git-read-tree.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ OPTIONS
3838

3939
--reset::
4040
Same as -m, except that unmerged entries are discarded instead
41-
of failing. When used with `-u`, updates leading to loss of
42-
working tree changes will not abort the operation.
41+
of failing. When used with `-u`, updates leading to loss of
42+
working tree changes or untracked files or directories will not
43+
abort the operation.
4344

4445
-u::
4546
After a successful merge, update the files in the work

Documentation/git-reset.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ linkgit:git-add[1]).
6969

7070
--hard::
7171
Resets the index and working tree. Any changes to tracked files in the
72-
working tree since `<commit>` are discarded.
72+
working tree since `<commit>` are discarded. Any untracked files or
73+
directories in the way of writing any tracked files are simply deleted.
7374

7475
--merge::
7576
Resets the index and updates the files in the working tree that are

0 commit comments

Comments
 (0)