cm0002@mander.xyz to Programmer Humor@programming.dev · 1 month agoWhen you have to checkout the master branchlemmy.worldimagemessage-square35linkfedilinkarrow-up11arrow-down10
arrow-up11arrow-down1imageWhen you have to checkout the master branchlemmy.worldcm0002@mander.xyz to Programmer Humor@programming.dev · 1 month agomessage-square35linkfedilink
minus-squareEager Eagle@lemmy.worldlinkfedilinkEnglisharrow-up0·1 month agoit has always bothered me that checkout is overloaded: it can switch branches or discard pending changes in an unrecoverable way. so, PSA, you can replicate the safe part of checkout with git switch and the unsafe with git restore.
minus-squaresik0fewl@lemmy.calinkfedilinkarrow-up0·1 month agoSwitch and restore came later because checkout was problematic.
minus-squarenightlily@leminal.spacelinkfedilinkEnglisharrow-up0·edit-21 month agoHas someone made a „Checkout considered harmful“ blog post yet or do we not do that anymore?
minus-squareSleeplessCityLights@programming.devlinkfedilinkarrow-up0·1 month agoJust alias stuff like that, make it coherent.
minus-squareScrollone@feddit.itlinkfedilinkarrow-up0·1 month agoI agree, I wonder why they decided to design it that way in the first place.
it has always bothered me that checkout is overloaded: it can switch branches or discard pending changes in an unrecoverable way.
so, PSA, you can replicate the safe part of checkout with
git switchand the unsafe withgit restore.Ah, I love coherent software.
Switch and restore came later because checkout was problematic.
Has someone made a „Checkout considered harmful“ blog post yet or do we not do that anymore?
Just alias stuff like that, make it coherent.
I agree, I wonder why they decided to design it that way in the first place.