Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

出bug:mgit init -g 命令初始化的多仓库目录与manifest.json文件不符(mgit其他命令默认拉取的相符合) #14

Open
youlongfeixue opened this issue Apr 8, 2023 · 0 comments

Comments

@youlongfeixue
Copy link

youlongfeixue commented Apr 8, 2023

我的manifest.json文件如下

{
    "remote": "[email protected]:yxxxxxxe", 
    "version":1,
    "mgit-excluded": false,
    "dest": "../Developments",
    "repositories": {
        "MainProject": {
            "abs-dest": "./",
            "remote-path": "mainProject.git",
            "config-repo": true
        },
        "SKSugarSwift": {
            "remote": "[email protected]:yxxxxxxe",
            "remote-path": "SKSugarSwift.git"
        }
    }
}

这时候的多仓库路径应该是这样的
【document-01】

- work
      - MainProject
            - .mgit
            - manifest.json
      - Developments
            - SKSugarSwift

而当在空文件夹下使用 mgit init -g xxx.git 命令初始化的结构是这样的 (目录结构显然不正确):
【document-02】

- work
      - MainProject
            - .mgit
            - manifest.json
            - Developments
                  - SKSugarSwift

并提示初始化成功

[~] 开始初始化多仓库...
[~] 正在克隆主仓库...
[✔] 主仓库克隆完成!
[~] 正在克隆子仓库...
[✔] (1/1) "SKSugarSwift"克隆完成!
[✔] 多仓库初始化成功!

这样,再次执行 mgit status 命令(任何一个正确的mgit命令),都会自动「从本地导出」子仓库,然后目录结构才会跟【document-01】一致,才是正确的!

----------------
| 从本地导出   |
| ----------   |
| SKSugarSwift |
----------------
[~] 以上仓库本地缺失,处理中...
[##############################] 100%
[~] 正在检查各仓库状态...
[##############################] 100%

不过这种情况需要将主仓库的 .git 文件夹从 .mgit/source-git/MainProject/.git 中移到主仓库目录中。


另一种情况,如果本地有主仓库,执行 mgit status 命令(任何一个正确的mgit命令),都会再次拉一遍远程子仓库,这时候目录结构跟【document-01】一致,是正确的。

如果我的描述不清楚,欢迎联系我QQ:781058139 ,一起解决问题。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant