Show HN: Effective Git

(github.com)

36 points | by nola-a 5 days ago ago

6 comments

  • tomtom1337 2 days ago

    I'd recommend using git switch instead of checkout, since the checkout command is so overloaded. And restore instead of checkout for restoring changes.

    • musicmatze a day ago

      Unfortunately, muscle memory cannot be changed that easily. And thanks to the git maintainers, the checkout command still exists, because apparently they know that.

  • ralferoo 2 days ago

    After using git for about 15 years, I still find "git merge" unpleasant and hard to track changes. I've always had better experiences rebasing my branch on top of the current main and then committing the resultant changes. Of course it helps if you are regularly rebasing from main rather than leaving it until the end, but the process still usually feels cleaner than with git merge.

    The only downside of rebasing (for me) is it looks confusing when commits aren't sequentially in date order, and sometimes it feels like you need to resolve the same conflict several times (once for each commit that gets rebased if they touch the same code) but that usually works out better for me than a regular merge.

  • eviks 2 days ago

    > This document wants to be a reference for best practices in the daily use of Git

    Then it wouldn't stick to the most ineffective interface for git - cli

  • Valodim 2 days ago

    Eh. If you're interested in sharpening your vcs toolchain, just learn jj already

    • yogorenapan 2 days ago

      I've learnt jujutsu. It took me a couple weeks to get it but 100℅ worth it. I've always intuitively understood git but jj does make a lot of annoying things easy. My commit history is now much cleaner than ever before. It's not for everyone though. Takes a lot of upfront investment to learn when git is often already good enough.