Windows 如何在不同的目录中跟踪git存储库?
所以我有一个项目是git repo,它包含另一个git存储库。所以结构是这样的:Windows 如何在不同的目录中跟踪git存储库?,windows,git,git-submodules,Windows,Git,Git Submodules,所以我有一个项目是git repo,它包含另一个git存储库。所以结构是这样的: /gitProject /other /stuff /anotherGitProject 目前,我已经将另一个gitProject设置为gitProject的子模块。我的问题是,我必须将另一个Git项目部署到硬盘的另一部分。由于另一个GitProject的功能是一个附加组件,因此我只需将另一个GitProject的内容直接复制到另一个项目的目录树中: /gitProject /ot
/gitProject
/other
/stuff
/anotherGitProject
目前,我已经将另一个gitProject设置为gitProject的子模块。我的问题是,我必须将另一个Git项目部署到硬盘的另一部分。由于另一个GitProject的功能是一个附加组件,因此我只需将另一个GitProject的内容直接复制到另一个项目的目录树中:
/gitProject
/other
/stuff
/anotherGitProject
/otherProject
/(contents of anotherGitProject+otherProject)
我的问题是:如何跟踪我对gitProject中另一个gitProject所做的更改?这似乎真的很复杂,但我需要在其他项目的基础上对另一个Git项目进行更改,否则这不会成为问题。我的想法是:
- 在
中克隆另一个GitProject,otherProject
或者甚至作为其他项目(如果
的内容需要直接在其他GitProject
中,在这种情况下:其他项目
- 在
otherProject.tmp
- 将另一个GitProject克隆为另一个项目
- 复制
otherProject.tmp中
otherProject.tmp的其余内容
- 添加.gitignore以忽略任何不是另一个GitProject的原始内容
- 在
- 向
初始回购(该回购是另一个gitProject
的子模块)添加指向gitProject
otherProject
otherProject
直接返回到anotherGitProject
如果anotherGitProject
作为一个插件是otherProject
的一个简单子目录,那么过程就简单得多,因为正如我在第一点中提到的,您可以直接在目标中克隆anotherGitProject
。远程步骤相同:
cd /gitProject/anotherGitProject
git add remote anotherGitProjectDeployed /path/to/otherProject/anotherGitProject
谢谢你的帮助。对我来说,关键是为另一个gitProject创建一个remote。因为我没有它,所以我必须在github上创建我自己的版本,然后将它用作gitProject中的子模块。