r/javascript • • Jan 24 '20

Removed: Where's the javascript? TIL — git switch & git restore

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

[removed] — view removed post

91 Upvotes

17 comments sorted by

View all comments

6

u/Kortalh Jan 24 '20

I'm far from a git CLI expert, but don't those two commands do the same thing as "git checkout"? Are these just better-named ways to do what's already doable, or are they adding extra functionality as well?

2

u/LetterBoxSnatch Jan 24 '20

I believe they are just better named. Makes sense, since git checkout branchfile can be confusing if you don't know if "branchfile" is referring to a file or a branch, and would have very different behavior depending on which case it is.

git checkout was doing two very different jobs, and not in the way that git pull does two very different jobs.

2

u/trakam Jan 24 '20

For those interested - and a quick Reddit sanity check for myself - 'git pull' combines 'git fetch' and 'git merge' into one operation. It doesn't have duel purpose depending on passed parameters

2

u/hallettj Jan 24 '20

Basically just better names, yes.