Я добавил некоторые шаблоны Haml для моего проекта Rails 3 с помощью
git clone git://github.com/psynix/rails3_haml_scaffold_generator.git lib/generators/haml
только для того, чтобы найти, когда я попытался отредактировать некоторые из этих файлов, это был подмодуль, поэтому я не мог зафиксировать изменения, внесенные в каталог lib/generators/haml
. Теперь каждый раз, когда я git status
, я получаю
# 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")
но git add lib/generators/haml
не действует. Я просто хочу иметь файлы, а не подмодуль, но я не могу избавиться от подмодуля:
> 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
Дополнительные git add
бесполезны. Если я попробую git rm -rf lib/generators/haml
, я получаю
fatal: git rm: 'lib/generators/haml': Operation not permitted
Он просто не умрет! Я просмотрел как удалить подмодули, но в этом случае нет файла .submodules
, и нет упоминания о подмодуле в .git/config
. Но если я запустил git submodule update
, я получаю
No submodule mapping found in .gitmodules for path 'lib/generators/haml'
Я удалил каталог, но получаю те же результаты! Что происходит? Мне нужно создать файл .gitmodules
только для удаления подмодуля?