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

时间:2014-11-25 08:15:29

标签: git teamcity

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

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

我已尝试过以下内容:

创建回购1

cd c:\temp
mkdir g1
cd g1
git init
echo lala > ape.txt
git add *
git commit -m "initial commit"

克隆到裸仓2

cd c:\temp
git clone --bare g1 g2

创建一个与g1

具有相同内容的新目录
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

0 个答案:

没有答案