git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* merge --squash strange error
@ 2012-10-29 13:37 Angelo Borsotti
  0 siblings, 0 replies; only message in thread
From: Angelo Borsotti @ 2012-10-29 13:37 UTC (permalink / raw)
  To: git

Hello,

I have got a case in which merge --squash issues an error that does
not exist. I hope I am wrong, though.
Consider the following example:

rm -rf public.git
rm -rf private
git init --bare public.git
git clone public.git private
cd private
touch f1; git add f1; git commit -m A
git checkout -b b1
touch f2; git add f2; git commit -m B
git checkout master
git checkout -b b2
touch f3; git add f3; git commit -m C
git checkout master
git checkout -b b3
touch f4; git add f4; git commit -m D

--- at this point we have

     A (f1)             master
      |--B (f1,f2)     b1
      |--C (f1,f3)     b2
      `--D (f1,f4)     *b3

git merge --squash b1
git merge --squash b2

The first merge adds f2 to the workspace, which then contains f1, f2 and f4.
The second merge should add f3, and instead it complains:

error: Your local changes to the following files would be overwritten by merge:
        f2
Please, commit your changes or stash them before you can merge.
Aborting

Why should it overwrite f2, and with what?

-Angelo

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-10-29 13:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-29 13:37 merge --squash strange error Angelo Borsotti

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).