Merge complaining that .gitmodules was deleted by us.

425 views
Skip to first unread message

Elliot Glaysher (Chromium)

unread,
Jul 18, 2012, 1:04:58 PM7/18/12
to Stefan Zager, Chromium-dev
[erg@elliotg:src] (dialogs-part-whatever)
$ git merge master
[....]
CONFLICT (modify/delete): v8 deleted in HEAD and modified in master.
Version master of v8 left in tree at v8~master.
[...]
CONFLICT (modify/delete): tools/grit deleted in HEAD and modified in
master. Version master of tools/grit left in tree at
tools/grit~master.
CONFLICT (modify/delete): third_party/webpagereplay deleted in HEAD
and modified in master. Version master of third_party/webpagereplay
left in tree at third_party/webpagereplay~master.
CONFLICT (modify/delete): third_party/trace-viewer deleted in HEAD and
modified in master. Version master of third_party/trace-viewer left in
tree at third_party/trace-viewer~master.
CONFLICT (modify/delete): third_party/syzygy/binaries deleted in HEAD
and modified in master. Version master of third_party/syzygy/binaries
left in tree.
CONFLICT (modify/delete): third_party/skia/src deleted in HEAD and
modified in master. Version master of third_party/skia/src left in
tree at third_party/skia/src~master.
CONFLICT (modify/delete): third_party/skia/include deleted in HEAD and
modified in master. Version master of third_party/skia/include left in
tree at third_party/skia/include~master.
CONFLICT (modify/delete): third_party/libyuv deleted in HEAD and
modified in master. Version master of third_party/libyuv left in tree
at third_party/libyuv~master.
CONFLICT (modify/delete): third_party/libjingle/source deleted in HEAD
and modified in master. Version master of third_party/libjingle/source
left in tree at third_party/libjingle/source~master.
CONFLICT (modify/delete): third_party/libexif/sources deleted in HEAD
and modified in master. Version master of third_party/libexif/sources
left in tree at third_party/libexif/sources~master.
CONFLICT (modify/delete): third_party/cros_system_api deleted in HEAD
and modified in master. Version master of third_party/cros_system_api
left in tree at third_party/cros_system_api~master.
CONFLICT (modify/delete): third_party/WebKit deleted in HEAD and
modified in master. Version master of third_party/WebKit left in tree
at third_party/WebKit~master.
[...]
CONFLICT (content): Merge conflict in chrome/nacl/DEPS
[...]
CONFLICT (modify/delete): .gitmodules deleted in HEAD and modified in
master. Version master of .gitmodules left in tree.
Automatic merge failed; fix conflicts and then commit the result.

I swear that I haven't deleted .gitmodules! Is there any way to
recover from this?

-- Elliot

Adam Langley

unread,
Jul 18, 2012, 1:09:21 PM7/18/12
to e...@chromium.org, Stefan Zager, Chromium-dev
On Wed, Jul 18, 2012 at 1:04 PM, Elliot Glaysher (Chromium)
<e...@chromium.org> wrote:
> [erg@elliotg:src] (dialogs-part-whatever)
> I swear that I haven't deleted .gitmodules! Is there any way to
> recover from this?

A couple of hints:

If you want to abort the merge, `git log` to find a good point
(probably the most recent commit prior to the merge) and `git reset
--hard <ref>` to revert to it. Revert does imply what you might fear
however.

`git checkout master .gitmodules` will copy master's version of
.gitmodules to the current tree. You can do this without the git reset
if you want to try and roll with the merge.


Cheers

AGL

Bernhard Bauer

unread,
Jul 18, 2012, 1:20:03 PM7/18/12
to a...@chromium.org, e...@chromium.org, Stefan Zager, Chromium-dev
On Wed, Jul 18, 2012 at 7:09 PM, Adam Langley <a...@chromium.org> wrote:
On Wed, Jul 18, 2012 at 1:04 PM, Elliot Glaysher (Chromium)
<e...@chromium.org> wrote:
> [erg@elliotg:src] (dialogs-part-whatever)
> I swear that I haven't deleted .gitmodules! Is there any way to
> recover from this?

A couple of hints:

If you want to abort the merge, `git log` to find a good point
(probably the most recent commit prior to the merge) and `git reset
--hard <ref>` to revert to it. Revert does imply what you might fear
however.

`git reset --merge` also aborts the current merge and resets you to the state precisely before you started the merge.

Bernhard.
 
`git checkout master .gitmodules` will copy master's version of
.gitmodules to the current tree. You can do this without the git reset
if you want to try and roll with the merge.


Cheers

AGL

--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
    http://groups.google.com/a/chromium.org/group/chromium-dev

Jay Soffian

unread,
Jul 18, 2012, 2:06:00 PM7/18/12
to bau...@google.com, a...@chromium.org, e...@chromium.org, Stefan Zager, Chromium-dev
The canonical way[*] to abort a merge with modern git is:

$ git merge --abort

[*] Well, as much as anything in git has a canonical form.

(Under the hood, this is implemented as "reset --merge", but I try to
avoid reset except when I need it, as it's a very over-loaded
command.)

j.
Reply all
Reply to author
Forward
0 new messages