在Windows中合并多个git仓库给我一个错误 [英] Combining multiple git repositories in windows gives me an error
问题描述
我尝试遵循以下问题:组合多个git仓库以在Windows中组合多个仓库10,但这给了我一个错误:
I tried to follow this question: Combining multiple git repositories to combine multiple repositories in Windows 10, but it gives me an error:
"sed"不会对内部或外部的内容进行重新标记, "sed",它不被识别为内部或外部命令,
"sed" no se reconoce como un comando interno o externo, "sed" it is not recognized as an internal or external command,
即使没有它对我也不起作用!这是Jhipster中的微服务(minimo1& 2)的结构:
and even without it doesn't work for me! This is the structure of a microservice (minimo1 &2) in Jhipster:
microsvc1test
|- gateway
| |_.git
|- jhipster-registry
| |_.git
|-minimo1
| |_.git
|-minimo2
| |_.git
- 我遵循第1步(完成zip文件的好主意)
- 我遵循步骤2A:创建CD microsvc1test/gateway/gateway,然后将microsvc1test/gateway的内容移至microsvc1test/gateway/gateway(其他相同)
我真的不需要保留故事,并且此命令在Windows中不起作用.
I do not really need to keep the story and this command does not work in 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
- 这是新结构(第3步):
microsvc1test
|- gateway
| |_.git
| |-gateway
| |_(the code...)
|- jhipster-registry
| |_.git
| |- jhipster-registry
| |_(the code...)
|-minimo1
| |_.git
| |-minimo1
| |_(the code...)
|-minimo2
| |_.git
| |-minimo2
| |_(the code...)
- 然后,执行第4步:
cd microsvc1test git init
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
所以我得到了其中的几个:
so I get several of this:
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为空.
Then, I create a new repository on GitHub, commit and push, but the gateway, jhipster-registry, minimo1 & minimo2 are empty.
推荐答案
我将删除所有隐藏的.git目录,然后使用git init创建一个新的git存储库.然后,一切都与普通的一样.您将松散每个单独存储库的所有提交,但它应该可以工作.试试吧
I would delete all the hidden .git directories and then create a new git repository with git init. Then all the same as a regular one. You will loose all the commits of each of the individual repositories, but it should work. Try it
这篇关于在Windows中合并多个git仓库给我一个错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!