summaryrefslogtreecommitdiff
path: root/builtin/commit.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2019-03-29 17:39:11 +0700
committerJunio C Hamano <gitster@pobox.com>2019-04-02 13:57:00 +0900
commit7968bef06b750fe9c59c1e1d0573bffc5b3cd94f (patch)
tree3c85aabdf72839cf3b414fe260aaca5540561add /builtin/commit.c
parente342c63a4e070bd1398b9aa86ac4ce917edbadc7 (diff)
switch: only allow explicit detached HEAD
"git checkout <commit>" will checkout the commit in question and detach HEAD from the current branch. It is naturally a right thing to do once you get git references. But detached HEAD is a scary concept to new users because we show a lot of warnings and stuff, and it could be hard to get out of (until you know better). To keep switch a bit more friendly to new users, we only allow entering detached HEAD mode when --detach is given. "git switch" must take a branch (unless you create a new branch, then of course switch can take any commit-ish) Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit.c')
0 files changed, 0 insertions, 0 deletions