From: Geoff Russell <hidden> Date: 2016-06-15 22:46:47
How do I merge a branch X into my master and tell git that whenever there
is a conflict, the file on X should prevail? This is for a scripted
application.
Cheers,
Geoff
From: Johannes Sixt <hidden> Date: 2016-06-15 22:46:47
Geoff Russell schrieb:
How do I merge a branch X into my master and tell git that whenever there
is a conflict, the file on X should prevail? This is for a scripted
application.
I assume you talk about file-level (content) merges.
There is no such tool, and the reason is that what you try to do here does
not make sense *in general*. It must be a very special kind of project
where you can blindly trust one side over the other if there are
conflicts, and that you can additionally trust non-conflicting content merges.
The best you can do is perhaps to pipe conflicting files through
sed -e '/^<<<<<<</,/^=======/d' -e '/^>>>>>>>/d'
-- Hannes
From: Geoff Russell <hidden> Date: 2016-06-15 22:46:47
On 5/18/09, Johannes Sixt [off-list ref] wrote:
Geoff Russell schrieb:
quoted
How do I merge a branch X into my master and tell git that whenever there
> is a conflict, the file on X should prevail? This is for a scripted
> application.
I assume you talk about file-level (content) merges.
Yes.
There is no such tool, and the reason is that what you try to do here does
not make sense *in general*. It must be a very special kind of project
where you can blindly trust one side over the other if there are
conflicts, and that you can additionally trust non-conflicting content merges.
The file is data coming out of an interactive program which reads
the entire file, edits and then writes the entire file at which point
this file is correct
and all previous versions are obsolete. I don't really want a merge
at all, but just
want to replace the file in the master with the version on the branch.
Thanks anyway.
Cheers,
Geoff.
The best you can do is perhaps to pipe conflicting files through
sed -e '/^<<<<<<</,/^=======/d' -e '/^>>>>>>>/d'
-- Hannes
--
6 Fifth Ave,
St Morris, S.A. 5068
Australia
Ph: 041 8805 184 / 08 8332 5069
From: Johannes Sixt <hidden> Date: 2016-06-15 22:46:47
Geoff Russell schrieb:
The file is data coming out of an interactive program which reads
the entire file, edits and then writes the entire file at which point
this file is correct
and all previous versions are obsolete. I don't really want a merge
at all, but just
want to replace the file in the master with the version on the branch.
Ah, so finally you say what you mean ;)
You can define a custom merge driver that always returns the content of
the second branch. See 'man gitattributes'.
-- Hannes
How do I merge a branch X into my master and tell git that whenever there
is a conflict, the file on X should prevail? This is for a scripted
application.
I assume you talk about file-level (content) merges.
There is no such tool, and the reason is that what you try to do here does
not make sense *in general*. It must be a very special kind of project
where you can blindly trust one side over the other if there are
conflicts, and that you can additionally trust non-conflicting content merges.
The best you can do is perhaps to pipe conflicting files through
sed -e '/^<<<<<<</,/^=======/d' -e '/^>>>>>>>/d'
-- Hannes
From: Geoff Russell <hidden> Date: 2016-06-15 22:46:47
On Mon, May 18, 2009 at 6:31 PM, Johannes Sixt [off-list ref] wrote:
Geoff Russell schrieb:
quoted
The file is data coming out of an interactive program which reads
the entire file, edits and then writes the entire file at which point
this file is correct
and all previous versions are obsolete. I don't really want a merge
at all, but just
want to replace the file in the master with the version on the branch.
Ah, so finally you say what you mean ;)
You can define a custom merge driver that always returns the content of
the second branch. See 'man gitattributes'.
-- Hannes
Sorry for the confusion. A custom merge driver will work fine ... but I
will also rethink carefully what I am doing.
Cheers,
Geoff.