Archive

Archive for August, 2020

Things You Want to Do in Git and How to Do Them

August 13, 2020 Leave a comment

Git is a very powerful tool, but infamously it’s also a very confusing one. And that has additional effects on how developers use it. New developers often struggle with how long their commits should be, but part of that is just that they’re not comfortable with git’s tools, because they naturally force you into certain sizes due to convenience.

When you make a commit, think–will I or someone else likely have to git revert it? In that case, I should make the change as isolating as possible, so that the revert is as peaceful as possible.

Am I about to make changes that might blow up and force me to git reset to an earlier state? Well, maybe I should commit my peaceful changes right now so they don’t end up as collateral damage.

Just keep thinking about how you’ll use git’s tools when you inevitably fuck up, and how you can make your commits as convenient as possible for your future self, and that will guide you on the proper length and breadth of your commits.

Now, many articles try to instill in readers a fundamental understanding of how git works, but if most people are like me that just causes my eyes to glaze over as a quick google search turns into a lecture. I think you’ll just get it as you use git more. At first, you just have things you want to do, and no idea how to do them, because git’s commands are seriously unintuitive once you do most things (like, why does checkout do 3 completely different tasks?)

https://stu2b50.dev/posts/things-you-wante9665

Source:
https://weekly.statuscode.com/

Categories: git, Interesting