«Игнорировать» двоичные файлы в git rebase «их» - PullRequest
3 голосов
/ 22 декабря 2010

Я хочу уйти от этого

A - B - C - D - E - F - G 

где Branch1 указывает на E, а Branch2 указывает на G

к этому:

Branch1:    A - B - C - D - E
                     \
Branch2:              F - G

И я хочу, чтобы Branch2 всегда «побеждал», я дошел до этого:

git rebase -s recursive -X theirs --onto C Branch1 Branch2

Это отлично работает - за исключением того, что дроссели дросселей на двоичных файлах - говорят, что не могут их объединить Как мне сказать git, что я не хочу объединять их, я просто хочу брать их каждый раз?

Ответы [ 2 ]

1 голос
/ 08 февраля 2011

Как мне сказать git, что я не хочу объединять их, я просто хочу брать «их» каждый раз?

Это было бы с пользовательским объединениемдрайвер, который вы можете специально связать со всеми двоичными файлами (*.dll, *.exe, *.so, ... независимо от вашего конкретного двоичного расширения в вашем случае)

См. "git merge -s theirsнеобходимо - но я знаю, что"для иллюстрации не существует.

Что я не проверял, так это: применяется ли пользовательский драйвер слияния во время rebase --onto.

0 голосов
/ 22 декабря 2010

Следующий выстрел в темноте:

Из документации git-rebase:

   -m, --merge
       Use merging strategies to rebase. When the recursive (default)
       merge strategy is used, this allows rebase to be aware of renames
       on the upstream side.

       Note that a rebase merge works by replaying each commit from the
       working branch on top of the <upstream> branch. Because of this,
       when a merge conflict happens, the side reported as ours is the
       so-far rebased series, starting with <upstream>, and theirs is the
       working branch. In other words, the sides are swapped.

   -X <strategy-option>, --strategy-option=<strategy-option>
       Pass the <strategy-option> through to the merge strategy. This
       implies --merge and, if no strategy has been specified, -s
       recursive. Note the reversal of ours and theirs as noted in above
       for the -m option.

Если -X подразумевает --merge и --merge swaps theirs и ours, возможно, в этом проблема. Что произойдет, если вы переключите theirs на ours?

...