简体   繁体   中英

git submodule in stage - how to remove?

I have some items with "archive" label in my gitlab web interface:

在此处输入图片说明

Problem is what my local repo have real files in this directory:

在此处输入图片说明

I can't push changes from this directory to remote server. I tried to remove yii2-rbac from remote server:

git rm --cached path/to/yii2-rbac

But it didn't work, after next push, mysterious file with same name 'yii2-rbac' appears again...

How can I fix it?

update: I have taken into account comments and realized what I deal with submodules:

git ls-files --stage | grep $160000

160000 3fc4af92c20ca2bf97bf01a50819565b5a6fe621 0   path/to/yii2-migration-utility
160000 c6d315a3c9652b3b1ced19fe105f65e6e09f375b 0   path/to/yii2-rbac

One question: how can I delete these submodules and start using path/to/yii2-rbac as usual directory?

I found solution which works for me. In main git repo:

rm -rf path/to/child/.git

Will remove "submodule" status from directory (but all files still remains). In GitLab interface this directory now looks like common folder:

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM