b0rk,
@b0rk@jvns.ca avatar

a git cheat sheet

b0rk,
@b0rk@jvns.ca avatar

really appreciated everyone's suggestions on the previous thread! https://social.jvns.ca/@b0rk/112276852440106066

I only included things that I actually do in the cheat sheet (with a couple of exceptions like git push -u, which I only don't use because I have push.autoSetupRemote true configured) but there are a lot of other useful-looking tips in that thread that I don't personally use

b0rk,
@b0rk@jvns.ca avatar

the only other things in this cheat sheet that I personally don't use are git switch and git restore, which I actually think seem like great choices (the fact that git checkout THING just GUESSES if you want to switch to a branch or restore an old version of the file is kind of scary! git switch doesn't do that! and git checkout's syntax is just really weird!), but I'm used to git checkout and it doesn't cause me a lot of problems so I haven't been motivated to change my ways

gsuberland,
@gsuberland@chaos.social avatar

@b0rk

> so I haven't been motivated to switch

I see what you did there

Neblib,
@Neblib@mastodo.neoliber.al avatar

@b0rk I totally share the inability to stop using git checkout and switch to the better commands.

robinm,
@robinm@fosstodon.org avatar

@b0rk Am-I blind or is git bisect missing (I would have expected to find it in the archeology section)? Other than that it's a fantastic cheat sheet.

b0rk,
@b0rk@jvns.ca avatar

@robinm i don’t really use bisect so i left it out

pmbrent,
@pmbrent@hachyderm.io avatar

@b0rk One of my best friends who doesn't work in tech just asked if I could help them better understand git, and I immediately thought of this post. Thank you!! 💖

b0rk,
@b0rk@jvns.ca avatar

@pmbrent I hope it helps!

pierrepo,
@pierrepo@mamot.fr avatar

@b0rk Would you mind adding "git add -u" to put in the staged area all modified tracked files?

b0rk,
@b0rk@jvns.ca avatar
fatboy,
@fatboy@fosstodon.org avatar

@b0rk geat sheet, giteat sheet

foolishowl,
@foolishowl@social.coop avatar

@b0rk I started looking for this poster on your website, and at least I found the bingo card.

https://wizardzines.com/comics/git-discussion-bingo/

b0rk,
@b0rk@jvns.ca avatar

@foolishowl here's a link, I'm not totally confident that it'll print correctly though so I'm not sharing it widely yet https://wizardzines.com/git-cheat-sheet.pdf

martinpeck,
@martinpeck@fosstodon.org avatar

@b0rk I need this as a laptop sticker, or on a drinks mat! Awesome cheat sheet!

annika,
@annika@xoxo.zone avatar

@b0rk Showing a commit history and rebase using little icons on the commits is such a good idea!

kernellogger,
@kernellogger@fosstodon.org avatar

@b0rk maybe it's just me, but somehow I missed a short mention of "git diff" or a pointer to the "diff staged/unstaged changes" section in "know where you are" (or maybe in "prepare to commit"?), as that will show you what you are about to commit – which is usually what I really want to do to prevent doing something stupid. But as I said, maybe that's just me.

[Edit: or maybe move the "diff staged/unstaged changes" between "know where you are" and "prepare to commit"?]

isaac,
@isaac@hachyderm.io avatar

@b0rk I love the little scribble for each commit

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