DEV Community

Discussion on: Rebase to the future!

Collapse
 
sparkcruz profile image
Roger Cruz

Rebase is a nice trick, but not a real workflow:

  1. use of --force to push your changes;
  2. conflicts ignored;
  3. code gets shoved at the line-numbers as it rewrites the diffs.

Just pull and merge, it's ok. Don't lie to git's history.

Collapse
 
lexlohr profile image
Alex Lohr

It depends on how you work. If your branch is only being worked on by you and/or your team, just communicate before you git push -f it, so everyone will be up to date afterwards. If that doesn't work for you, merge and silently cry about your ugly git history.

Collapse
 
willamesoares profile image
Will Soares • Edited

Saying that rebase is not a real workflow is relative. It will depend on what level you are rebasing things. Although it might not be the best option when you do not put your work in separate branches and instead commit everything to the default branch, I can say that rebasing makes your git history much cleaner. So a good approach in my opinion is when you work in separate branches and use rebase on those to clean history a little bit and then after that you merge to the default branch, which should give you merge commits, which believe me can be really helpful.

Collapse
 
jessekphillips profile image
Jesse Phillips

Git push --force-with-lease

That is a slightly safer push, wish the command was shorter.

Using git to communicate, I believe requires rebase.

Collapse
 
konrad_126 profile image
konrad_126

Hello Roger,

I wouldn't call rebase a "trick". It's a git command like any other.

Whether you'll use it depends on your(team's) workflow.