this post was submitted on 04 Apr 2024
1108 points (98.3% liked)
Programmer Humor
19623 readers
1 users here now
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.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
How would rebasing my own branch work? Do I rebase the main into my branch, or make a copy of the main branch and then rebase? I have trouble grasping how that would work.
You're still rebasing your branch onto main (or whatever you originally branched it off of), but you aren't then doing a fast forward merge of main to your branch.
The terminology gets weird. When people say "merge versus rebase" they really mean it in the context of brining changes into main. You (or the remote repository) cannot do this without a merge. People usually mean "merge commit versus rebase with fast forward merge"
Yeah I was confused because you are right, merge is usually refered as the git merge and then git commit.
It makes sense. Thanks for the clarification
Here's an example
Say I work on authentication under
feature/auth
Monday and get some done. Tuesday an urgent feature request for some logging work comes in and I complete it onfeature/logging
and merge clean to main. To make sure all my code from Monday will work, I will then switch tofeature/auth
and thengit pull --rebase origin main
. Now my auth commits start after the merge commit from the logging pr.Thanks for the example. Rebase use is clearer now.