]> git.ipfire.org Git - thirdparty/git.git/blobdiff - Documentation/git-checkout.txt
Merge branch 'nd/checkout-m-doc-update'
[thirdparty/git.git] / Documentation / git-checkout.txt
index 9a396498d106e1f3ff581d465c072d90686f8c21..877e5f503a66145912886c14917f0e68512e6284 100644 (file)
@@ -242,6 +242,8 @@ should result in deletion of the path).
 +
 When checking out paths from the index, this option lets you recreate
 the conflicted merge in the specified paths.
++
+When switching branches with `--merge`, staged changes may be lost.
 
 --conflict=<style>::
        The same as --merge option above, but changes the way the
@@ -260,6 +262,9 @@ the conflicted merge in the specified paths.
 This means that you can use `git checkout -p` to selectively discard
 edits from your current working tree. See the ``Interactive Mode''
 section of linkgit:git-add[1] to learn how to operate the `--patch` mode.
++
+Note that this option uses the no overlay mode by default (see also
+`--[no-]overlay`), and currently doesn't support overlay mode.
 
 --ignore-other-worktrees::
        `git checkout` refuses when the wanted ref is already checked
@@ -280,6 +285,13 @@ section of linkgit:git-add[1] to learn how to operate the `--patch` mode.
        Do not attempt to create a branch if a remote tracking branch
        of the same name exists.
 
+--[no-]overlay::
+       In the default overlay mode, `git checkout` never
+       removes files from the index or the working tree.  When
+       specifying `--no-overlay`, files that appear in the index and
+       working tree, but not in <tree-ish> are removed, to make them
+       match <tree-ish> exactly.
+
 <branch>::
        Branch to checkout; if it refers to a branch (i.e., a name that,
        when prepended with "refs/heads/", is a valid ref), then that
@@ -289,7 +301,7 @@ section of linkgit:git-add[1] to learn how to operate the `--patch` mode.
 +
 You can use the `"@{-N}"` syntax to refer to the N-th last
 branch/commit checked out using "git checkout" operation. You may
-also specify `-` which is synonymous to `"@{-1}`.
+also specify `-` which is synonymous to `"@{-1}"`.
 +
 As a special case, you may use `"A...B"` as a shortcut for the
 merge base of `A` and `B` if there is exactly one merge base. You can