2010-10-04 10 views
7

Attualmente sto lavorando su un progetto su git-hub ma il nostro team di sviluppo sta usando subversion. Ho fatto quanto segue per mantenere git-hub sincronizzati con il nostro repository svn:git svn rebase non riesce con un conflitto in un file che non esiste in git

git svn rebase 
git pull origin master 
git push origin master 

Questo sta funzionando benissimo, ma in qualche modo ho incasinato qualcosa e ora ho un problema con un file quando faccio il rebase:

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 

devo aver cancellato e ri-ha aggiunto il file in git e/o svn e ora ho questo problema. La cosa strana è che il file README non appare nel mio attuale git master. Ho provato a eliminarlo dal mio tronco svn, ma questo non fa differenza. Ho risolto il conflitto e ho aggiunto nuovamente il file, ecc. Inutilmente. Ho persino cancellato il mio git locale e ricominciato da capo. Qualcosa deve essere corrotto.

Ho provato anche git rebase --skip, ma che mi dà:

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$ 

Qualcuno sa come posso risolvere questo problema? Mi sta facendo impazzire. Non ho affatto bisogno del file README, quindi non mi interessa se devo solo soffiarlo e ricrearlo. Grazie!

risposta

3

Hai provato git rebase --skip? Mantenere un repository Git separato sarà soggetto a problemi. git dcommit riscrive i commit git locali (ad esempio, cambia i checksum SHA-1). Così, nel vostro flusso di lavoro normale:

  • codice cambiamento
  • impegnano a GitHub
  • codice cambiamento
  • impegnano a GitHub
  • git svn rebase
  • git maestro origine tirare
  • git push origine master
  • git svn dcommit

Il git pull fa due cose, uno git fetch seguito da un git merge. L'unione può essere un problema. Inoltre, in quest'ultimo dcommit, i commit git locali sono stati modificati e non corrispondono più a quello che è stato inviato a github nel comando precedente.

È possibile leggere su git-svn here.

+1

Ho provato git rebase --skip ma questo mi ha dato più errori, li aggiungerò alla mia domanda originale. –

+1

p.s. grazie per aver cercato di aiutare e anche per chiarire, in pratica non stiamo apportando modifiche tramite git, sto semplicemente aggiornando il git master dal nostro repository di subversion, tutte le modifiche sono fatte esclusivamente in svn, quindi avevo sperato che non fosse troppo fastidioso –

Problemi correlati