this post was submitted on 08 Nov 2023
81 points (85.8% liked)

Programming

17025 readers
105 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 !webdev@programming.dev



founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] thequickben@lemmy.ml 11 points 10 months ago (3 children)

I honestly don’t get why folks dislike rebase. I use it constantly, especially to squash commits so that my pull requests are a single commit that can be reverted easily.

[–] mortonfox@pawb.social 7 points 10 months ago

I use rebase when I'm working in a dev branch. If someone else has pushed changes to the main branch, rebasing the dev branch on top of main is a way to do the hard work of resolving merge conflicts up front. Then I can rerun tests and make sure everything still works with changes from the main branch. And finally, when it is time to merge my dev branch to main, it's a simple fast-forward.

[–] yaaaaayPancakes@lemmy.world 2 points 10 months ago (1 children)

Because rebase is fraught with peril, if you also push rebased branches upstream and someone else works off that branch.

If you stick to the rule of only using rebase on local branches that have never been pushed upstream, it's an awesome tool. If you don't, you're eventually going to cause someone to have a bad day.

[–] bellsDoSing@lemm.ee 2 points 10 months ago (1 children)

Yeah, basically anything that rewrites already pushed history and is then (force-) push is bound to create problems (unless it's a solo dev only ever coding on a single device, who uses the remote repo as a mere backup solution).

[–] thequickben@lemmy.ml 2 points 10 months ago

Yep. I work exclusively in forks, and all my work is done on my machine, rebased, squashed and then pushed to my fork for a PR. No commits from main are ever touched in my rebase. It’s such a clean workflow for me.