From 32669671c7746888aa1e3832907deb7fc8405061 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 8 Feb 2011 04:32:49 -0600 Subject: [PATCH] checkout: introduce --detach synonym for "git checkout foo^{commit}" For example, one might use this when making a temporary merge to test that two topics work well together. Patch by Junio, with tests from Jeff King. [jn: with some extra checks for bogus commandline usage] Suggested-by: Jeff King Signed-off-by: Junio C Hamano Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- Documentation/git-checkout.txt | 13 ++++- builtin/checkout.c | 25 +++++++-- t/t2020-checkout-detach.sh | 95 ++++++++++++++++++++++++++++++++++ 3 files changed, 126 insertions(+), 7 deletions(-) create mode 100755 t/t2020-checkout-detach.sh diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt index 22d36114df..d162117e71 100644 --- a/Documentation/git-checkout.txt +++ b/Documentation/git-checkout.txt @@ -9,6 +9,7 @@ SYNOPSIS -------- [verse] 'git checkout' [-q] [-f] [-m] [] +'git checkout' [-q] [-f] [-m] [--detach] [] 'git checkout' [-q] [-f] [-m] [[-b|-B|--orphan] ] [] 'git checkout' [-f|--ours|--theirs|-m|--conflict=