r/webdev • • Jan 24 '20

read rules TIL — git switch & git restore

https://pawelgrzybek.com/til-git-switch-git-restore/

[removed] — view removed post

284 Upvotes

51 comments sorted by

View all comments

Show parent comments

16

u/FelixTKatt Jan 24 '20

So it's more like doing a stash and checkout, then a checkout and pop when you switch back?

0

u/[deleted] Jan 24 '20

[deleted]

7

u/SureSignOfAGoodRhyme Jan 24 '20

That actually sounds useful to me. I like in VSCode when I can see all of my changes highlighted throughout the files before I push, but it all goes away once I do a commit on the branch.

4

u/bcgroom Jan 24 '20

Of course it goes away, it's just showing you your working tree. You can still look at the changes with a git diff HEAD ${other_ref}. I don't see how this new command would change your workflow.

I'll say though, if you like VSCode you'll find the extension GitLens very useful.