usar tag remote pushed hacer drop delete create como image git corruption git-push

image - tag - Imágenes corruptas tras git push



git-- tags (1)

También tuve este problema: aquí hay un .gitattributes genérico que parece generalmente seguro para los repositorios web de php que funcionaron para mí: https://github.com/Danimoth/gitattributes/blob/master/Web.gitattributes

ejecutar git check-attr --all - path / to / png antes y después de agregar los nuevos atributos de gitat mostró que el archivo de imagen se trató originalmente como un archivo de texto, y ahora es binario (tenga en cuenta que tuve que confirmar / presionar los atributos .gitat archivo para que tenga efecto en el mando a distancia)

En caso de que el enlace se apague:

# These settings are for any web project # Handle line endings automatically for files detected as text # and leave all files detected as binary untouched. # * text=auto # NOTE - originally I had the above line un-commented. it caused me a lot of grief related to line endings because I was dealing with WordPress plugins and the website changing line endings out if a user modified a plugin through the web interface. commenting this line out seems to have alleviated the git chaos where simply switching to a branch caused it to believe 500 files were modified. # # The above will handle all files NOT found below # # ## These files are text and should be normalized (Convert crlf => lf) # # source code *.php text *.css text *.sass text *.scss text *.less text *.styl text *.js text *.coffee text *.json text *.htm text *.html text *.xml text *.svg text *.txt text *.ini text *.inc text *.pl text *.rb text *.py text *.scm text *.sql text *.sh text *.bat text # templates *.ejs text *.hbt text *.jade text *.haml text *.hbs text *.dot text *.tmpl text *.phtml text # server config .htaccess text # git config .gitattributes text .gitignore text .gitconfig text # code analysis config .jshintrc text .jscsrc text .jshintignore text .csslintrc text # misc config *.yaml text *.yml text .editorconfig text # build config *.npmignore text *.bowerrc text # Heroku Procfile text .slugignore text # Documentation *.md text LICENSE text AUTHORS text # ## These files are binary and should be left untouched # # (binary is a macro for -text -diff) *.png binary *.jpg binary *.jpeg binary *.gif binary *.ico binary *.mov binary *.mp4 binary *.mp3 binary *.flv binary *.fla binary *.swf binary *.gz binary *.zip binary *.7z binary *.ttf binary *.eot binary *.woff binary *.pyc binary *.pdf binary

Agregué algunas imágenes .png a mi repositorio git y luego las puse en mi repositorio remoto. Noté que las imágenes están en el repositorio remoto, pero están rotas.

Para verificar esto, comparé los datos binarios de las imágenes en mis repositorios locales y remotos. También ejecuté el comando de file en imágenes en ambos repositorios.

Imagen en repositorio local.

Primeras 10 líneas de datos binarios:

8950 4e47 0d0a 1a0a 0000 000d 4948 4452 0000 0019 0019 00p. 3c3f 7870 6163 6b65 7420 6265 6769 6e3d 22ef bbbf 2220 6964 3d22 5735 4d30 4d70 4365 6869 487 537a 4e54 637a 6b63 3964 223f 3e78 3c78 3a78 6d70

Resultado del comando de file :

bundles / admin / public / images / messages-icon.png: datos de imagen PNG, 24 x 16, RGBA de 8 bits / color, no entrelazados

Imagen empujada a repositorio remoto

Primeras 10 líneas de datos binarios:

8950 4e47 0a1a 0a00 0000 0d49 4844 5200 0000 1900 0000 1408 0600 0000 78bd 9600 0019 7445 5874 536f 6674 7761 7265 0041 646p. 3f78 7061 636b 6574 2062 6567 696e 3d22 efbb bf22 2069 643d 2257 354d 304d 7043 6568 6948 7a72 6553 7a4e 5463 7a6b 6339 6422 3f3e 203c 783a 786d 706d

Resultado del comando de file :

paquetes / admin / public / images / notifications-icon.png: datos

¿Por qué sucedería esto? Busqué en todo Google y en este sitio en busca de respuestas, pero no he encontrado ninguna.