fosstodon.org is one of the many independent Mastodon servers you can use to participate in the fediverse.
Fosstodon is an invite only Mastodon instance that is open to those who are interested in technology; particularly free & open source software. If you wish to join, contact us for an invite.

Administered by:

Server stats:

11K
active users

@adamchainz In principle this makes a lot of sense, but in practice I find myself wanting to throw away uncommitted changes a lot more often than I want to keep them without committing or stashing them, so I'd say "avoid" is too strong here; it depends on your workflow. Ideally one should know about all the modes and when to use them. But I'd definitely agree that `git reset --hard` gets way more "press" than it deserves.

(On a separate note, my own pick for most underappreciated reset mode would be `git reset --mixed -N`)

@jelloeater Thank you! Enjoy the new Git post from today as well, and the 46 more in the archive! adamj.eu/tech/tag/git/

adamj.euAdam Johnson

@adamchainz how is it different than `git reset` with no argument?

@drlazor8 'reset' is one of those weird dual-purpose commands - using it without arguments unstages files, so they won't be committed. This action is best done with the newer 'git restore' command, instead:

git-scm.com/docs/git-restore

I don’t cover this old way of using 'git reset' in my writing because it makes it harder to learn.

git-scm.comGit - git-restore Documentation