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

Re: Why is it bad to rewind a branch that has already been pushed out?

From
Theodore Tso <tytso@mit.edu>
Date
Feb 3, 2007, 13:20 UTC
Message-ID
<20070203132059.GB15419@thunk.org>
In-Reply-To
<7v1wl7bv66.fsf@assigned-by-dhcp.cox.net>
On Fri, Feb 02, 2007 at 10:40:49PM -0800, Junio C Hamano wrote:
Show 28 quoted lines
> I do not think this is a good explanation.  For example, if we
> do this:
> 
> (1) I build a series and push it out.
> 
> 	---o---o---o---j
> 
> (2) Alice clones from me, and builds two commits on top of it.
> 
> 	---o---o---o---j---a---a
> 
> (3) I rewind one and build a few, and push them out.
> 
> 	---o---o---o...j
>                     \
>                      h---h---h---h
> 
> (4) Alice pulls from me again:
> 
> 	---o---o---o---j---a---a---*
>                     \             /
>                      h---h---h---h
> 
> Contrary to the description, git will happily have Alice merge
> between the two branches, and never gets confused.
> 
> Maybe I did not want to have 'j' because it was an incomplete
> solution to some problem....

Another scenario might be if 'j' was just a bad idea, and should have never been committed in the first place. Now if Alice builds upon it, and at some later point Alice asks you to pull from her repository, 'j' will appear back in your repository. So it's better to have a changeset which simply undoes 'j' rathern than rewind, once you've pushed out the repository.

The one exception to this is if 'j' contains something which might be problematic from a copyright point of view, in which case you're largely screwed if other people such as Alice has already pulled from you and started basing changes on 'j'.

							- Ted
Previous: Andy ParkinsNext: Robin Rosenberg
Message 5 of 12 in “Why is it bad to rewind a branch that has already been pushed out?”
  1. Junio C HamanoFeb 3, 2007
  2. Andy ParkinsFeb 3, 2007
  3. Junio C HamanoFeb 3, 2007
  4. Andy ParkinsFeb 4, 2007
  5. Theodore TsoFeb 3, 2007
  6. Robin RosenbergFeb 4, 2007
  7. Junio C HamanoFeb 4, 2007
  8. Documentation: add KMail in SubmittingPatchesMichael, Feb 5, 2007
  9. Junio C HamanoFeb 6, 2007
  10. MichaelFeb 6, 2007
  11. Jakub NarebskiFeb 6, 2007
  12. Andy ParkinsFeb 6, 2007

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.