From b9e4ed66d507afdba6c8fd2644e42ba79d6e9ee1 Mon Sep 17 00:00:00 2001 From: bl-ue <54780737+bl-ue@users.noreply.github.com> Date: Wed, 13 Jan 2021 08:39:56 -0500 Subject: [PATCH] git-checkout-index: add page (#5107) * git-checkout-index: add page * Update pages/common/git-checkout-index.md * Apply suggestions from code review Co-authored-by: Starbeamrainbowlabs Co-authored-by: Starbeamrainbowlabs --- pages/common/git-checkout-index.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 pages/common/git-checkout-index.md diff --git a/pages/common/git-checkout-index.md b/pages/common/git-checkout-index.md new file mode 100644 index 0000000000..c1e448b923 --- /dev/null +++ b/pages/common/git-checkout-index.md @@ -0,0 +1,20 @@ +# git checkout-index + +> Copy files from the index to the working tree. +> More information: . + +- Restore any files deleted since the last commit: + +`git checkout-index --all` + +- Restore any files deleted or changed since the last commit: + +`git checkout-index --all --force` + +- Restore any files changed since the last commit, ignoring any files that were deleted: + +`git checkout-index --all --force --no-create` + +- Export a copy of the entire tree at the last commit to the specified directory (the trailing slash is important): + +`git checkout-index --all --force --prefix={{path/to/export_directory/}}`