Frontend developer by day, iOS developer by night. Currently working on learning iOS development and my own blog, Mike Decodes, where I'm decoding the tech industry. Come hang out with me on Twitter!
In what way would you say checkout is misleading? I'd love to dive into that 😄
I did a quick search for git restore and it seems it's still experimental, so I wonder if it's a good idea to advice that. I'll definitely try it out the next time I need it, tho!
I said "misleading" in the sense that it's used for various purposes - Using checkout you can:
Create a branch (with the -b flag)
Switch to a branch
Reset and revert file
Now, you can use git switch and git restore to avoid such confusion with the checkout command - switch -c creates a branch, switch switches to a branch, and restore is for reverting.
Frontend developer by day, iOS developer by night. Currently working on learning iOS development and my own blog, Mike Decodes, where I'm decoding the tech industry. Come hang out with me on Twitter!
Yeah that makes more sense! I get what you are saying and I agree that having the specific command is much clearer. I'm still a little thrown off by the experimental part of the command. All in due time I suppose :)
The most enlighting command I find out not so long ago is git add -p ...then whatever... it let you add single chunks of files to stage areas.
It is a godsend when working on complex problems. You can add related chunks in the same commit between files. So commits are still atomic and related to a single change.
Frontend developer by day, iOS developer by night. Currently working on learning iOS development and my own blog, Mike Decodes, where I'm decoding the tech industry. Come hang out with me on Twitter!
I don't often use tag, but I really like the use cases for tagging version releases. If you ever need to pick something from a specific version, you can just hop into the tag!
Software producer specialized in data and distributed systems.
Past: tech lead for Disney+ DRM (NYC), consulting and contracting (NYC), startup scene, Salesforce, full-time lab staff.
Frontend developer by day, iOS developer by night. Currently working on learning iOS development and my own blog, Mike Decodes, where I'm decoding the tech industry. Come hang out with me on Twitter!
Since Git 2.23.0, you can use
git restore. It's a huge improvement over the sometimes-misleading checkout command.In what way would you say
checkoutis misleading? I'd love to dive into that 😄I did a quick search for
git restoreand it seems it's still experimental, so I wonder if it's a good idea to advice that. I'll definitely try it out the next time I need it, tho!Sorry for the confusion.
I said "misleading" in the sense that it's used for various purposes - Using
checkoutyou can:-bflag)Now, you can use
git switchandgit restoreto avoid such confusion with thecheckoutcommand -switch -ccreates a branch,switchswitches to a branch, andrestoreis for reverting.Yeah that makes more sense! I get what you are saying and I agree that having the specific command is much clearer. I'm still a little thrown off by the experimental part of the command. All in due time I suppose :)
This one is golden, thanks :)
git commit --amend --no-editI agree.. this one is golden. And I am sure, now I am going to use this a lot.
The most enlighting command I find out not so long ago is
git add -p ...then whatever...it let you add single chunks of files to stage areas.It is a godsend when working on complex problems. You can add related chunks in the same commit between files. So commits are still atomic and related to a single change.
I don't often use tag, but I really like the use cases for tagging version releases. If you ever need to pick something from a specific version, you can just hop into the tag!
Great addition :)
Your list is well-assembled! Thanks!
Thank you very much :)