Commit 7968bef
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>1 parent e342c63 commit 7968bef
1 file changed
+34
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| |||
1298 | 1299 | | |
1299 | 1300 | | |
1300 | 1301 | | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
1301 | 1325 | | |
1302 | 1326 | | |
1303 | 1327 | | |
| |||
1345 | 1369 | | |
1346 | 1370 | | |
1347 | 1371 | | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
1348 | 1380 | | |
1349 | 1381 | | |
1350 | 1382 | | |
| |||
1602 | 1634 | | |
1603 | 1635 | | |
1604 | 1636 | | |
| 1637 | + | |
1605 | 1638 | | |
1606 | 1639 | | |
1607 | 1640 | | |
| |||
1633 | 1666 | | |
1634 | 1667 | | |
1635 | 1668 | | |
| 1669 | + | |
1636 | 1670 | | |
1637 | 1671 | | |
1638 | 1672 | | |
| |||
0 commit comments