给定一个 git 存储库,其中有一个我已经签出子模块的目录,我如何重命名顶级目录?
$ git init
Initialized empty Git repository in /home/work/asdasd/.git/
$ mkdir asd
$ touch asd/.keepme
$ git add asd/.keepme
$ git commit -a -m "asd"
[master (root-commit) 932f011] asd
0 files changes
create mode 100644 asd/.keep
$ git submodule add git@github.com:test/test.git asd/subdir
Cloning into 'asd/subdir'...
remote: Counting objects: 800, done.
remote: Compressing objects: 100% (281/281), done.
remote: Total 800 (delta 523), reused 786 (delta 509)
Receiving objects: 100% (800/800), 109.46 KiB, done.
Resolving deltas: 100% (523/523), done.
$ git commit -a -m "submodule"
[master e0fe8e7] submodule
2 files changed, 4 insertions(+)
create mode 100644 .gitmodules
create mode 160000 asd/subdir
现在,如果我尝试重命名asd
目录,则会出现错误:
$ git mv asd foo
fatal: source directory is empty, source=asd/subdir, destination=foo/subdir
我该如何重命名它?