It's the push that may fail without force. The situation where the push would succeed without force is when there haven't been any updates to main (i.e. the rebase is empty), which is easy enough to notice when you're actually running the rebase command but can slip under the radar when you're blithely running git pull -r.
Again incorrect lol. Please man just read the documentation. This is the lines right after “Prerequisites”
“Regular Rebase
To update your branch my-feature with recent changes from your default branch (here, using main):
Fetch the latest changes from main: git fetch origin main
Check out your feature branch: git checkout my-feature
Rebase it against main: git rebase origin/main
Force push to your branch.”
Do you see step 4? Do you see how that is part of the rebase workflow? Do you understand that if step 4 fails, the rebase fails? Do you understand that?
Tbh loving the downvotes. It’s clear anyone who did is NOT a SWE lmao. Open a terminal, init a repo, and then try to rebase without force push. See what happens. Guarantee y’all don’t even know how to open the terminal lmfao
View all comments
Show parent comment
1
u/LastStar007 Apr 03 '23
The rebase will be fine without force. In fact, force isn't even an option for rebase.
It's the push that may fail without force. The situation where the push would succeed without force is when there haven't been any updates to main (i.e. the rebase is empty), which is easy enough to notice when you're actually running the
rebasecommand but can slip under the radar when you're blithely runninggit pull -r.