b0rk, (edited )
@b0rk@jvns.ca avatar

poll: to switch branches in git, do you use git checkout or git switch?

pfmoore,
@pfmoore@mastodon.social avatar

@b0rk I've used checkout for so long, changing would be a struggle. Also, when I tried the other day, git switch v1.0 failed because v1.0 is a tag but not a branch. Having to know/remember details like that is painful - checkout is much more DWIM in practice...

b0rk,
@b0rk@jvns.ca avatar

@pfmoore yeah that makes sense! my impression isgit switch v1.0 failing is intended to be helpful (to prevent you accidentally ending up in detached HEAD state if you didn't mean to) but I'm not sure if it's always helpful in practice

pfmoore,
@pfmoore@mastodon.social avatar

@b0rk yep, the "you are now in detached HEAD state" message told me that in any case :-) Given that checking out a commit is non-destructive, I'm not sure there's that much benefit to failing rather than doing it and warning, but YMMV I guess...

b0rk,
@b0rk@jvns.ca avatar

@pfmoore yea stuff like this is why I've been reluctant to unreservedly recommend that folks use switch instead of checkout, even though some people seem to like it

twipped,
@twipped@twipped.social avatar

@b0rk @brooke I click on the branch in tower 😛

tbroyer,
@tbroyer@piaille.fr avatar

@b0rk It took me some time to… switch (sic!) from checkout to switch (and restore) but it didn't actually took me much effort once I decided to do it. I don't think I'll ever go back.

DiazCarrete,
@DiazCarrete@hachyderm.io avatar

@b0rk switch all the way, I find checkout confusing because it does way too many things.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • rosin
  • magazineikmin
  • GTA5RPClips
  • khanakhh
  • InstantRegret
  • Youngstown
  • mdbf
  • slotface
  • thenastyranch
  • everett
  • osvaldo12
  • kavyap
  • cubers
  • DreamBathrooms
  • megavids
  • Durango
  • modclub
  • ngwrru68w68
  • vwfavf
  • ethstaker
  • tester
  • cisconetworking
  • tacticalgear
  • Leos
  • provamag3
  • normalnudes
  • anitta
  • JUstTest
  • All magazines