2011-02-22 20 views
81

Aquí está mi transcripción de intentar fusionar mi rama de corrección de errores en mi rama principal en preparación para empujarla hacia arriba. Se han producido algunos cambios en la cadena ascendente en el maestro desde que se creó la rama de corrección de errores, y ahora se niega a volver a establecer la base.Git rebase falla, 'Tus cambios locales a los siguientes archivos se sobrescribirán mediante fusión'. No hay cambios locales?

Los archivos en los que arroja errores no se difieren al abrirlos. ningún archivo ha sido agregado, eliminado o renombrado. No se ignora nada y no se rastrea ni se escenifica ni se extrapola nada. Estoy completamente perplejo sobre por qué la rebase está fallando.

estoy en OS X 10.6.6 y git 1.7.4

.-(/Volumes/joshua/www/txfunds)-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------([email protected])- 
`--> git rebase bug586-test master-test 
First, rewinding head to replay your work on top of it... 
Applying: - comiitting code related to api permissions 
Using index info to reconstruct a base tree... 
Falling back to patching base and 3-way merge... 
error: Your local changes to the following files would be overwritten by merge: 
    inc/data.inc 
    templates/apipermissions_tpl.inc 
    templates/currencies_tpl.inc 
Please, commit your changes or stash them before you can merge. 
Aborting 
Failed to merge in the changes. 
Patch failed at 0001 - comiitting code related to api permissions 

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". 



.-(/Volumes/joshua/www/txfunds)-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------([email protected])- 
`--> git status 
# Not currently on any branch. 
nothing to commit (working directory clean) 



.-(/Volumes/joshua/www/txfunds)-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------([email protected])- 
`--> git rebase --abort 
HEAD is now at 5efccf1 - comiitting code related to api permissions 



.-(/Volumes/joshua/www/txfunds)-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------([email protected])- 
`--> git log -n10 --oneline 
5efccf1 - comiitting code related to api permissions 
a8a5ee4 Style changes for IE 
cfca618 Style changes for IE 
8a69de6 Style changes for IE 
8946585 - comiitting code related to api permissions - fixed an html error in the currencies template 
5fba0a9 Merges the 1.11b branch bugfixes and changes into trunk 
ef57049 Andrew Commiting on Blakes behalf on changes he made to transfers; Also an Indue GW balance fix; debitcarupload fix for LSN 
69e4313 Fixed an issue with Support From email 
9058fb6 Sets the svn property svn:eol-style to LF, to enforce unix style line endings 
240839e Fixes up a lot of the whitespace issues. 



.-(/Volumes/joshua/www/txfunds)-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------([email protected])- 
`--> git checkout bug586-test 
Switched to branch 'bug586-test' 



.-(/Volumes/joshua/www/txfunds)-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------([email protected])- 
`--> git log -n10 --oneline 
b7b1f8a Resolves #586, Postback on deposit 
5fba0a9 Merges the 1.11b branch bugfixes and changes into trunk 
ef57049 Andrew Commiting on Blakes behalf on changes he made to transfers; Also an Indue GW balance fix; debitcarupload fix for LSN 
69e4313 Fixed an issue with Support From email 
9058fb6 Sets the svn property svn:eol-style to LF, to enforce unix style line endings 
240839e Fixes up a lot of the whitespace issues. 
cf27b6f - bug that came up with transferring. The transfer page had a hidden field called to, which was taking precedence over cards and usercard which would throw the system out a bit 
7c21a81 Fixes #603, new add transaction form, journalled. 
01e6292 Removes a pile of resource forks 
880c5bc - bug that came up with transferring. The transfer page had a hidden field called to, which was taking precedence over cards and usercard which would throw the system out a bit 



.-(/Volumes/joshua/www/txfunds)-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------([email protected])- 
`--> git rebase master-test bug586-test 
First, rewinding head to replay your work on top of it... 
Applying: Resolves #586, Postback on deposit 
Using index info to reconstruct a base tree... 
<stdin>:52: trailing whitespace. 
       'name' => 'Invoice Transfer Out', 
<stdin>:175: trailing whitespace. 

warning: 2 lines add whitespace errors. 
Falling back to patching base and 3-way merge... 
error: Your local changes to the following files would be overwritten by merge: 
    templates/deposit_tpl.inc 
Please, commit your changes or stash them before you can merge. 
Aborting 
Failed to merge in the changes. 
Patch failed at 0001 Resolves #586, Postback on deposit 

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". 



.-(/Volumes/joshua/www/txfunds)-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------([email protected])- 
`--> git rebase --abort 
HEAD is now at b7b1f8a Resolves #586, Postback on deposit 
+0

Debe publicar los contenidos de un estado de git, el contenido de su gitignore, y ls en los directorios en cuestión por separado, por lo que es más claramente legible. Eso podría ayudar a algunos, al menos. – Kzqai

+0

¿Tiene alguna configuración crlf o algo? Rebase no debería estar creando un árbol de trabajo sucio como ese. Y el 'estado de git' que podría ser útil es cuando falla la rebase. Se niega a correr con un árbol sucio; sabemos que está limpio antes de comenzar. Es el estado cuando * hay * modificaciones locales que causan un problema. – Cascabel

+0

¿Estás seguro del orden de los parámetros para git rebase? La primera referencia es la que se rebase a, mientras que la segunda referencia opcional es la que se revisará primero. Tal vez deberías cambiarlos. –

Respuesta

159

Ésta es la misma respuesta que otra de mis preguntas re problemas Git.

Estoy en un Mac, y este oscuro cambio de configuración parece solucionar todos mis problemas con respecto a los cambios no registrados cuando no los había.

git config --global core.trustctime false 

creo que tiene que ver con las diferencias entre los tiempos de archivos de Windows, Linux tiempos de archivo y tiempos de archivo mac. quien sabe, no dude en comentar si lo hace.

Actualización: This blog post explica qué está pasando, más o menos.

+1

Resolvió el problema para mí. –

+1

Gracias! Nunca lo hubiera averiguado. –

+1

Esa fue la magia especial. StackOverflow FTW nuevamente! –

27

Con respecto a la respuesta de Joshua Hogendorn: me parece que dejar Xcode abierto mientras se trabaja en el repositorio con git conduce a estos problemas. Incluso condujo a una situación en la que Git cometió algo que pensé que guardaba (y que aún tenía) pero Xcode simplemente escribió al sistema de archivos justo durante la rebase.

Así que: Cierre su proyecto Xcode antes de trabajar en el repositorio con git si quiere estar seguro, y entonces probablemente no necesite la configuración falsa core.trustctime.

+0

Tal vez tenías algún tipo de" guardado automático " archivo cada N minutos "configuración activa en su IDE? No hagas eso. –

+0

¡Lo intenté ... y funcionó para mí! Cierre xcode antes de hacer una rebase. Pierda mucho tiempo por nada. Gracias ! – Gros

+0

Tuve los mismos errores que antes aunque estoy usando Aptana Studio 3. Cuando salí de Aptana, funcionó la rebase. Desactivé la integración git de Aptana hace unos días. O no se apagó realmente o debería haber reiniciado Aptana. –

Cuestiones relacionadas