git/list[1] front-page[2] threads[3] people[4] search[5] about
 

using --force-with-lease after git rebase

From
Alexander Mills <alexander.d.mills@gmail.com>
Date
Oct 31, 2018, 19:13 UTC
Message-ID
<CA+KyZp5Zv77idtpu9jtxDUyE9zPP8UN3LsQBG=M5yM2cnMFgVQ@mail.gmail.com>
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?

-alex

related question: https://stackoverflow.com/questions/52823692/git-push-force-with-lease-vs-force/53042745#53042745

-- 
Alexander D. Mills
¡¡¡ New cell phone number: (415)730-1805 !!!
alexander.d.mills@gmail.com

www.linkedin.com/pub/alexander-mills/b/7a5/418/
Next: brian m. carlson
Message 1 of 3 in “using --force-with-lease after git rebase”
  1. Alexander MillsOct 31, 2018
  2. brian m. carlsonNov 1, 2018
  3. Junio C HamanoNov 1, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.