0
我有什么 我在另一个Git仓库中。 像嵌套库。 Git的。更改工作目录
Repo1/
.git
fileOfRepo1
Repo2/
.git
fileofRepo2
我已经做了在repo1和repo2一些承诺。
这里是问题 当检查到以前提交的repo1时,我希望将我的文件更改为先前提交的文件。这种情况发生在Repo1的文件中,它不适用于Repo2的文件。
然而,这确实认识到,事情发生在这里是我如何知道
如果我在最后Repo1的分支主犯我获得
$ git status
On branch master
nothing to commit, working directory clean
我以后做然而
$ git结帐SHA
我获得
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: Repo2 (new commits)
no changes added to commit (use "git add" and/or "git commit -a")
如果我使用子模块,我会键入:混帐子模块更新,我会得到想要的behaviur,但我确实没有想要使用的子模块。严重没有子模块的建议请。我可以更清楚没有子模块。
我正在使用本地存储库只是为了组织我自己的项目。
git子树也出来了吗?为什么你需要嵌套仓库?如果出于备份目的,请参阅[嵌套和独立GIT回购,备份,如何?](http://stackoverflow.com/questions/11269804/nested-and-independent-git-repos-for-backup-how)。如果要进行软件开发,可以考虑使用一个构建系统,在必要时从源代码树之外的git存储库安装依赖项,而不是将它们的repo嵌套到你的项目中。 –