From: Tay Ray Chuan Date: Mon, 21 Jun 2010 17:19:39 GMT Subject: [PATCH 0/3] teach git-checkout -B WAS builtin/checkout: DWIM with -f -b Message-ID: <1277140782-4064-1-git-send-email-rctay89@gmail.com> In-Reply-To: <7vpqzlrmo4.fsf@alter.siamese.dyndns.org> Right now, the -f/--force in git-checkout doesn't carry over to -b operations - ie. you can't do git checkout -b branch on an existing branch. This patch allows you to do this with the -B option, so that one can do git checkout -B branch ref which is equivalent to git branch -f branch ref && git checkout branch Contents: [PATCH 1/3] add tests for checkout -b [PATCH 2/3] builtin/checkout: change -b from an OPTION_STRING to a OPTION_SET_INT [PATCH 3/3] builtin/checkout: learn -B Tay Ray Chuan (3): add tests for checkout -b builtin/checkout: change -b from an OPTION_STRING to a OPTION_SET_INT builtin/checkout: learn -B Documentation/git-checkout.txt | 15 +++- builtin/checkout.c | 46 +++++++---- t/t2018-checkout-branch.sh | 166 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 209 insertions(+), 18 deletions(-) create mode 100755 t/t2018-checkout-branch.sh