我尝试遵循以下问题:Combining multiple git repositories在Windows 10中合并多个存储库,但这给了我一个错误:
“ sed”不能进行内部或外部的侦察, “ sed”,它不被识别为内部或外部命令,
即使没有它对我也不起作用!这是Jhipster中的微服务(minimo1&2)的结构:
microsvc1test
|- gateway
| |_.git
|- jhipster-registry
| |_.git
|-minimo1
| |_.git
|-minimo2
| |_.git
我真的不需要保留故事,该命令在Windows中不起作用。
$ git filter-branch --index-filter \
'git ls-files -s | sed "s#\t#&code/#" |
GIT_INDEX_FILE=$GIT_INDEX_FILE.new \
git update-index --index-info &&
mv $GIT_INDEX_FILE.new $GIT_INDEX_FILE' HEAD
microsvc1test
|- gateway
| |_.git
| |-gateway
| |_(the code...)
|- jhipster-registry
| |_.git
| |- jhipster-registry
| |_(the code...)
|-minimo1
| |_.git
| |-minimo1
| |_(the code...)
|-minimo2
| |_.git
| |-minimo2
| |_(the code...)
cd microsvc1test git init
D:\...\Jhipster\microsvc1test>git pull gateway
D:\...\Jhipster\microsvc1test>git pull jhipster-registry
D:\...\Jhipster\microsvc1test>git pull minimo1
D:\...\Jhipster\microsvc1test>git pull minimo2
所以我得到了其中的几个:
D:\BasuraTemporal\Jhipster\microsvc1test>git pull gateway
remote: Counting objects: 594, done.
remote: Compressing objects: 100% (564/564), done.
Receiving objects: 100% (594/594), 712.83 KiB | 0 bytes/s, done.
remote: Total 594 (delta 71), reused 0 (delta 0)R
Resolving deltas: 100% (71/71), done.
From gateway
* branch HEAD -> FETCH_HEAD
然后,我在GitHub上创建一个新的存储库,进行提交和推送,但是网关,jhipster-registry,minimo1和minimo2为空。
答案 0 :(得分:0)
我将删除所有隐藏的.git目录,然后使用git init创建一个新的git存储库。然后,一切都与普通的一样。您将松散每个单独存储库的所有提交,但它应该起作用。试试吧