如何使用裸存储库使用git?

如何使用裸存储库使用git?,git,teamcity,Git,Teamcity,我在使用裸git存储库时遇到问题 我们的构建服务器TeamCity似乎在克隆原始存储库时创建了裸存储库,我想手动更新子模块 我尝试了以下几点: 创建回购协议1 克隆到裸repo 2 创建一个与g1内容相同的新目录 mkdir测试 cd试验 echo lala>ape.txt git--git dir=…\g2--work tree=。地位 #论分行行长 #要提交的更改: #(使用“git重置磁头…”取消分级) # #已删除:ape.txt # #未跟踪的文件: #(使用“git add…”包含在

我在使用裸git存储库时遇到问题

我们的构建服务器TeamCity似乎在克隆原始存储库时创建了裸存储库,我想手动更新子模块

我尝试了以下几点:

创建回购协议1 克隆到裸repo 2 创建一个与g1内容相同的新目录
mkdir测试
cd试验
echo lala>ape.txt
git--git dir=…\g2--work tree=。地位
#论分行行长
#要提交的更改:
#(使用“git重置磁头…”取消分级)
#
#已删除:ape.txt
#
#未跟踪的文件:
#(使用“git add…”包含在将提交的内容中)
#
#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
git--git dir=/path/to/bare/repo--work tree=/path/to/checkoutdir子模块init
git--git dir=/path/to/bare/repo--work tree=/path/to/checkoutdir子模块???
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 --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