ho aggiunto alcuni modelli Haml ai miei Rails 3 progetto connon possono sbarazzarsi di git modulo
git clone git://github.com/psynix/rails3_haml_scaffold_generator.git lib/generators/haml
solo per scoprire, quando ho cercato di modificare alcuni di questi file, che si trattava di un modulo, in modo da Non è stato possibile eseguire il commit delle modifiche apportate all'interno della directory lib/generators/haml
. Ora ogni volta che git status
, ottengo
# 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")
ma git add lib/generators/haml
non ha alcun effetto. Ho davvero voglia di avere i file, non un sottomodulo, ma sto trovando il modulo impossibile sbarazzarsi di:
> 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
Ulteriori git add
s sono inutili. Se provo git rm -rf lib/generators/haml
, ottengo
fatal: git rm: 'lib/generators/haml': Operation not permitted
E 'solo che non morirà! Ho cercato how to delete submodules, ma in questo caso, non c'è il file .submodules
, né c'è menzione del sottomodulo in .git/config
. Eppure, se corro git submodule update
, ottengo
No submodule mapping found in .gitmodules for path 'lib/generators/haml'
ho cancellato la directory, ma ottengo gli stessi risultati! Cosa sta succedendo? Devo creare un file .gitmodules
solo per eliminare il sottomodulo?
Grazie, l'aggiunta a '.gitignore' è stata una buona idea. –
ma questo non spingerà i nuovi file nel repository, FYI – andho
il mio problema si è rivelato non correlato, ma questo ha aiutato. –