我在使用裸git存储库时遇到问题。
似乎我们的构建服务器TeamCity在克隆原始存储库时创建了裸存储库,并且我想手动更新子模块。
我已尝试过以下内容:
cd c:\temp
mkdir g1
cd g1
git init
echo lala > ape.txt
git add *
git commit -m "initial commit"
cd c:\temp
git clone --bare g1 g2
mkdir test
cd test
echo lala > ape.txt
git --git-dir=..\g2 --work-tree=. status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# deleted: ape.txt
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# ape.txt
为什么没有git认识到ape.txt文件已存在于存储库中?
我最终想要完成的是这样的事情
git --git-dir=/path/to/bare/repo --work-tree=/path/to/checkoutdir submodule init
git --git-dir=/path/to/bare/repo --work-tree=/path/to/checkoutdir submodule ??? <= to clone one specific submodule of several in the repository