{"thread":{"id":"37832","subject":"Problem with git when rebasing","startedAt":"2014-10-29T13:48:47Z","lastAt":"2014-10-29T13:48:47Z","messageCount":1,"participants":["Ismael Bouya"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"251176","messageId":"20141029134847.GF12302@ns208507.ip-188-165-209.eu","threadId":"37832","inReplyTo":null,"subject":"Problem with git when rebasing","fromName":"Ismael Bouya","fromEmail":"ismael.bouya@normalesup.org","sentAt":"2014-10-29T13:48:47Z","receivedAt":"2014-10-29T13:48:47Z","isPatch":false,"sender":{"key":"ismael.bouya@normalesup.org","avatar":null},"body":"Hi all,\ngit rebase can sometimes \"forget\" a commit, here is the workflow to reproduce\nthis problem:\n\n$ git init .\n$ echo \"content 1\" > file1\n$ git add file1 && git commit -m \"C1\"\n$ echo \"content 2\" > file2\n$ git add file2 && git commit -m \"C2\"\n$ echo \"content 3\" > file3\n$ echo \"content 2.3\" >> file2\n$ git add file3 && git commit -a -m \"C3\"\n$ echo \"content 4\" > file4\n$ git add file4 && git commit -a -m \"C4\"\n$ git rebase -i HEAD^^\n<change \"pick\" to \"edit\" for C2>\n$ echo \"content 2\" > file3\n$ git rebase --continue\n\nHere, we get an error\n------\nerror: The following untracked working tree files would be overwritten by merge:\n  file3\nPlease move or remove them before you can merge.\nAborting\nCould not apply <hash_C3>... C3\n------\nThis is expected, as we have created an untracked file which will be created\nlater.\n\nHowever, if we remove/move away the file3 which conflicts, the \"git status\"\ncommand is misleading, in the sense that it doesn't tell us to run\ngit cherry-pick <hash_C3>\nOr something approaching. If we don't, then commit <hash_C3> is completely\nforgotten by the rebasing once we continue it.\n\nMaybe a more explanatory error message would be useful? It is very unclear that\nthe commit won't apply when we continue the rebase workflow.\n\nKind regards,\n-- \nIsmael\n"}]}