this post was submitted on 11 Feb 2024
56 points (93.8% liked)

Programming

17270 readers
39 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities [email protected]



founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 6 points 8 months ago* (last edited 8 months ago) (2 children)

Same. I mostly use sourcetree to do quick self-reviews and to discard lines or hunks before a commit.

But I've also grown very weary of having to dig people out of git messes they've made with sourcetree and the likes.

Visual clients aren't to blame for that, but they contribute. So many times I've asked "and what git commands did that run?" only to receive a dumb stare as a reply.

[–] [email protected] 4 points 8 months ago (1 children)

Not entirely unexpected. If you don't know what you're doing, a GUI will only accelerate the path between you and the wrong result, because these tend to abstract things too much at times

[–] [email protected] 5 points 8 months ago (3 children)

Agreed. I've been trying to explain to someone recently why rebasing and force pushing their feature branch has no benefit when we use a squash commit strategy for merging to main.

Again, tools are not blame, but when combined with a lack of understanding and accumulated "git dogma", it can be quite disheartening.

[–] [email protected] 5 points 8 months ago

I had a really sad eye-opener at university, in my third year. We had a lecture where they tried to explain what version control is, and the entire 300-something person class just said fuck it. These people honestly think that copying code to USB sticks and gDrive is easier than learning 4 commands, and a git frontend

[–] [email protected] 2 points 8 months ago (1 children)

I've been trying to explain to someone recently why rebasing and force pushing their feature branch has no benefit when we use a squash commit strategy for merging to main.

While you're 100% right, is there anything wrong with this approach? Sometimes I like to keep by personal branches clean, especially before I open a PR.

[–] [email protected] 3 points 8 months ago

It depends on your intent. If you're doing it to keep history clean and linear in the long term, it's a huge waste of time as it gets splatted into a single squashed merge commit. It also makes it difficult for reviewers to rereview your changes as GitHub/Lab can't calculate the diff because you keep moving the goalposts with force pushes.

If you're doing it for cleanliness on your local branch then I guess that's fine, but I find it anti-social in a multi participant repo.

[–] [email protected] 2 points 8 months ago

I had the fortune of being the trainer for my company in all things git. I made sure that my colleagues (most of whom were straight out of universities) were introduced to git CLI and git concepts. No git GUIs were introduced. Consequently, the mess they made was easy to rectify. And then I occasionally read about horror stories like these where GUIs are allowed.

[–] [email protected] 2 points 8 months ago

I found SourceTree to be especially bad at this. For the inexperienced, I think Fork is a lot better. It also helps that you can inspect the commands that were executed by it.