añadí algunas plantillas Haml a mis Rails 3 proyecto conno puede deshacerse del submódulo git
git clone git://github.com/psynix/rails3_haml_scaffold_generator.git lib/generators/haml
sólo para descubrir, cuando traté de editar algunos de esos archivos, que se trataba de un submódulo, por lo No pude confirmar los cambios que hice en el directorio lib/generators/haml
. Ahora cada vez que git status
, me sale
# On branch master
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: lib/generators/haml
#
no changes added to commit (use "git add" and/or "git commit -a")
pero git add lib/generators/haml
no tiene ningún efecto. Realmente sólo quieren tener los archivos, no un submódulo, pero estoy encontrando el submódulo imposible deshacerse de:
> git rm --cached lib/generators/haml
rm 'lib/generators/haml'
> git status
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# deleted: lib/generators/haml
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# lib/generators/
> git commit -m "Removed submodule"
[master 02ae4c7] Removed submodule
1 files changed, 0 insertions(+), 1 deletions(-)
delete mode 160000 lib/generators/haml
> git status
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# lib/generators/
nothing added to commit but untracked files present (use "git add" to track)
> git add lib/generators/haml
> git status
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# new file: lib/generators/haml
#
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: lib/generators/haml
> git commit -m "Re-added lib/generators/haml"
[master c966912] Re-added lib/generators/haml
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 160000 lib/generators/haml
> git status
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: lib/generators/haml
adicionales git add
s son inútiles. Si intento git rm -rf lib/generators/haml
, consigo
fatal: git rm: 'lib/generators/haml': Operation not permitted
Simplemente no va a morir! He buscado how to delete submodules, pero en este caso, no hay ningún archivo .submodules
, ni hay ninguna mención del submódulo en .git/config
. Sin embargo, si me quedo git submodule update
, consigo
No submodule mapping found in .gitmodules for path 'lib/generators/haml'
He eliminado el directorio, pero me da los mismos resultados! ¿Que esta pasando? ¿Debo crear un archivo .gitmodules
solo para eliminar el submódulo?
Gracias, agregarlo a '.gitignore' fue una buena idea. –
pero esto no empujará los nuevos archivos en el repositorio, FYI – andho
mi problema resultó ser no relacionado, pero esto ayudó. –