Follow

I just learned a cool git thing.

You can use git switch [revision] -C [branchname] to move a branch to a specific revision and check it out in a single operation. This works even if you currently have that branch checked out.

Unlike git reset, which can do something similar, this operation is safe. If you have uncommitted changes, it'll fail instead of clobbering them.

So at this point I'd always recommend using git restore and git switch instead of git checkout and git reset

Sign in to participate in the conversation
Computer Fairies

Computer Fairies is a Mastodon instance that aims to be as queer, friendly and furry as possible. We welcome all kinds of computer fairies!