555
submitted 2 days ago by [email protected] to c/[email protected]

Git cheat sheets are a dime-a-dozen but I think this one is awfully concise for its scope.

  • Visually covers branching (WITH the commands -- rebasing the current branch can be confusing for the unfamiliar)
  • Covers reflog
  • Literally almost identical to how I use git (most sheets are either Too Much or Too Little)
you are viewing a single comment's thread
view the rest of the comments
[-] [email protected] 3 points 2 days ago* (last edited 1 day ago)

Huh, TIL.

To be fair, git switch was also derived from the features of git checkout in >2.23, but like git restore, the manual page warns that behavior may change, and neither are in my muscle memory (lmao).

I'll probably keep using checkout since it takes less kb in my head. ~~Besides, we still have to use checkout for checking out a previous commit, even if I learn the more ergonomically appropriate switch and restore.~~ No deprecation here so...

edit: maybe I got that java 8 mindset

edit 2: Correction -- git switch --detach checks out previous commits. Git checkout may only be there for old scripts' sake, since all of its features have been split off into those two new functions... so there's nothing really keeping me from switch.

[-] [email protected] 2 points 1 day ago

Besides, we still have to use checkout for checking out a previous commit

git switch works on commits too. I don't think you have to use checkout anymore.

[-] [email protected] 2 points 1 day ago

Oh, you're right. You just pass the -d detach flag. I stand corrected!

this post was submitted on 24 Sep 2024
555 points (99.3% liked)

Programming

17071 readers
414 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities [email protected]



founded 1 year ago
MODERATORS