diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-02-18 16:04:47 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-02-23 17:24:59 -0800 |
commit | 8e2dc6ac06ae90a00965e5c00aa4918dfd447639 (patch) | |
tree | 4416c20e19236c490a23045098dfa015163ab4d1 /builtin/mktree.c | |
parent | Git 1.7.4 (diff) | |
download | tgif-8e2dc6ac06ae90a00965e5c00aa4918dfd447639.tar.xz |
commit: give final warning when reattaching HEAD to leave commits behind
You can detach the HEAD at an arbitrary commit in order to browse the
files in various points in the history or build older versions of the
software, without recording any new commit, and come back to an existing
branch. When used in this "sightseer" mode, detached HEAD is a perfectly
safe mechanism. It also is a useful state to experiment with throw-away
commits.
When coming back to an existing branch with "git checkout master",
however, the commits that were created on the detached HEAD will become
unreachable from anywhere but the reflog of the HEAD. Check if the commit
we are about to leave is connected to some ref, and give a final warning
otherwise to remind the user for safety.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/mktree.c')
0 files changed, 0 insertions, 0 deletions