我有一个远程存储库,我们称之为subrepo。我想将其作为子树包含在本地存储库中,我们将其称为mainrepo。我将把subrepo放在路径“subrepofold/”下。
我像往常一样添加了遥控器:
git remote add subrepo git@remote.subrepo.git
Run Code Online (Sandbox Code Playgroud)
在mainrepo上我只有一个分支(master)。我添加并承诺了所有:
git add --all
git commit -m "message"
git status
Run Code Online (Sandbox Code Playgroud)
在分支 master 上没有任何可提交的内容,工作目录干净
git diff-index HEAD --exit-code --quiet
Run Code Online (Sandbox Code Playgroud)
不给我输出。跑步:
git subtree pull --prefix="subrepofold" subrepo master --squash
Run Code Online (Sandbox Code Playgroud)
我收到以下消息:
工作树有修改。无法添加。
我知道这似乎正是此处描述的问题,但似乎没有一个回复能够解决该问题。