using --force-with-lease after git rebase
- Date: Wed, 31 Oct 2018 12:13:06 -0700
- From: Alexander Mills <alexander.d.mills@xxxxxxxxx>
- Subject: using --force-with-lease after git rebase
I have been confused about the need for --force-with-lease after rebasing
Imagine I have a feature branch:
git checkout --no-track -b 'feature' 'origin/dev'
git push -u origin feature
I do some work, and then I rebase against origin/dev to keep up to
date with the integration branch.
git fetch origin/dev
git rebase origin/dev
then I try to push to the remote
git push origin feature
but that is rejected, I have to do:
git push --force-with-lease origin feature
why is that? Why do I need to force push my feature branch to the
remote tracking branch after rebasing against the integration branch?
Alexander D. Mills
¡¡¡ New cell phone number: (415)730-1805 !!!