git svn rebase терпит неудачу из-за конфликта с файлом, который не существует в git - PullRequest
7 голосов
/ 04 октября 2010

В настоящее время я работаю над проектом на git-hub, но наша команда разработчиков использует subversion.Я делал следующее, чтобы синхронизировать git-hub с нашим svn-репозиторием:

git svn rebase
git pull origin master
git push origin master

Это работает нормально, но почему-то я что-то испортил, и теперь у меня проблема с одним файломсделайте ребаз:

Craig-Nakamotos-MacBook-Pro:cl4 cnakamoto$ git svn rebase
First, rewinding head to replay your work on top of it...
Applying: minor fix to table class
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
No changes -- Patch already applied.
Applying: adding README file
Applying: adding README file
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
No changes -- Patch already applied.
Applying: adding README file
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
No changes -- Patch already applied.
Applying: adding README file
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
No changes -- Patch already applied.
Applying: adding README file
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
No changes -- Patch already applied.
Applying: adding README file
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
No changes -- Patch already applied.
Applying: adding README file
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
No changes -- Patch already applied.
Applying: adding README file
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
No changes -- Patch already applied.
Applying: adding README file
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
No changes -- Patch already applied.
Applying: adding README file
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
No changes -- Patch already applied.
Applying: adding README file
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
No changes -- Patch already applied.
Applying: adding README file
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
No changes -- Patch already applied.
Applying: adding README file
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
No changes -- Patch already applied.
Applying: adding README file
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
No changes -- Patch already applied.
Applying: adding README file
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
No changes -- Patch already applied.
Applying: adding README file
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
No changes -- Patch already applied.
Applying: remove README, will re-add via svn
Applying: trying to fix readme
Applying: adding README file
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
Auto-merging README
CONFLICT (add/add): Merge conflict in README
Failed to merge in the changes.
Patch failed at 0020 adding README file

When you have resolved this problem run "git rebase --continue".
If you would prefer to skip this patch, instead run "git rebase --skip".
To restore the original branch and stop rebasing run "git rebase --abort".

rebase refs/remotes/trunk: command returned error: 1

Я, должно быть, удалил и заново добавил файл в git и / или svn, и теперь у меня есть эта проблема.Странно то, что файл README не отображается в моем текущем мастере git.Я попытался удалить его из моего ствола SVN, но это не имеет значения.Я разрешил конфликт и заново добавил файл и т. Д. Безрезультатно.Я даже удалил свой локальный мерзавец и начал все сначала.Что-то должно быть повреждено.

Я также попробовал git rebase --skip, но это дает мне:

Craig-Nakamotos-MacBook-Pro:cl4 cnakamoto$ git rebase --skip
HEAD is now at c4da146 trying to fix readme
Applying: remove README, will re-add via svn
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
CONFLICT (delete/modify): README deleted in remove README, will re-add via svn and modified in HEAD. Version HEAD of README left in tree.
Failed to merge in the changes.
Patch failed at 0021 remove README, will re-add via svn

When you have resolved this problem run "git rebase --continue".
If you would prefer to skip this patch, instead run "git rebase --skip".
To restore the original branch and stop rebasing run "git rebase --abort".

Craig-Nakamotos-MacBook-Pro:cl4 cnakamoto$ 

Кто-нибудь знает, как я могу это исправить?Это сводит меня с ума.Мне вообще не нужен файл README, поэтому мне все равно, нужно ли просто сдувать его и воссоздавать.Спасибо!

1 Ответ

3 голосов
/ 04 октября 2010

Вы пробовали git rebase --skip?Поддержание отдельного git-репо будет проблемным.git dcommit переписывает ваши локальные коммиты git (т. Е. Изменяет контрольные суммы SHA-1).Итак, в вашем обычном рабочем процессе:

  • изменение кода
  • фиксация на github
  • изменение кода
  • фиксация на github
  • git svn rebase
  • мастер происхождения git pull
  • мастер происхождения git push
  • git svn dcommit

* git pull выполняет две вещи:git fetch с последующим git merge.Слияние может быть проблемой.Кроме того, в последнем dcommit локальные коммиты git были изменены и больше не соответствуют тому, что было передано github в предыдущей команде.

Вы можете прочитать о git-svn здесь .

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...