Rebasing is for noobs.
git reset head~42
git push -f
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
You had me a "Sydney Sweeney reveals".
Okay this is the second time I've seen Sydney Sweeney referenced in a meme in less than half a day. I had never heard of her before. Who is she, and why is she suddenly attracting so much meme attention?
She's an ~~Australian~~ American actress who blew up last year (she was in euphoria I think?), expect to see her in a ton of upcoming blockbusters.
She was excellent in the first season of White Lotus on Sky too. Great show.
She is from Spokane Washington not Australia. She got a lot of recognition for her role in Euphoria and is blowing up a bit right now because she is a young, attractive, talented actress.
Her blown up remains you mean?
Yeah, I had a feeling that was not the best way to put it but I was in a hurry :)
I used to only merge. Now I rebase. The repo is set up to require squash and rebase when going to main.
All the garbage "spelled thing wrong" and "ran formatter" commits go away. Main is clean and linear.
I think this is a fake quote that somebody made up for an Internet comedy bit, since it seems unlikely for Hollywood actress Sydney Sweeney to have such uncharacteristically strong opinion on software version control, of all things.
Because she of all people would know that there isn't anything wrong with using git merge
, and it ultimately comes down to personal preference to what you are used to.
But esteemed Academy Award nominated character actress and film director, Margot Robbie, if it's unlikely that Hollywood actress Sydney Sweeney said this... wouldn't it be just as unlikely that Margot Robbie would be here? Adding her own comment?
... are you projecting? Is there something you want to tell us esteemed Academy Award nominated character actress and film director Margot Robbie?
Fair point, Margot Robbie
That's esteemed Academy Award nominated character actress Margot Robbie to you!
And successful Hollywood film producer -- props on getting into the stakeholder end of the business so early in your career!
I mean, it’s posted in programming humor so yeah.
Anyone mind explaining to me how git rebase
is worth the effort?
git merge
has it's own issues but I just don't see any benefit to rebase over it.
The way I structure my commits, it is usually (but not always) easier and more reliable for me to replay my commits one at a time on top of the main branch and see how each relatively small change needs to be adapted in isolation--running the full test suite at each step to verify that my changes were correct--than to be presented with a slew of changes all at once that result from marrying all of my changes with all of the changes made to the main branch at once. So I generally start by attempting a rebase and fall back to a merge if that ends up creating more problems than it solves.
I use interactive rebases to clean up the history of messy branches so they can be reviewed commit by commit, with each commit representing one logical unit or type of change.
Mind you, getting those wrong is a quick way to making commits disappear into nothingness. Still useful if you're careful. (Or you can just create a second temporary branch you can fall back onto of you need up your first once.)
This 100%. I hate getting added to a PR for review with testing commits in the history, and I'm expected to clean those up before merging into main.
I feel like squash and merge on GitHub/GitLab is nicer for that anyway though, it makes the main branch so much cleaner automatically
If you're using "trunk-based development" (everything is a PR branch or in main), this works great.
If you're using GitFlow, it can make PRs between the major prod/dev/staging branches super messy. It would be nice if GitHub would let you define which merge strategies are allowed per-branch, but that's not a thing (AFAIK). So you're probably better off not squashing in this situation.
Well, rebase allows you to resolve the same conflict ten times in a row instead of doing it once. How cool is that?
Nope, you just need to do it once: https://git-scm.com/book/en/v2/Git-Tools-Rerere.
Squash your branch first
Doesn't this defeat the purpose, may as well merge then no?
Do not merge your unfinished stuff into main.
I don't like merging main into my branch because I don't understand git, and I feel like that can make a confusing history.