I tried using the answer involing git-filterbranch from this question http://stackoverflow.com/questions/277029/combining-multiple-git-repositories but running in trouble because this answer doesn't seems to work when repository name having a space in its name.
For example, this wouldn't work if the repository would be called "my figures" instead of "figures".
I'm running msysgit.
Here is a sample, with a "my figures" repository, wich is failling :
/d/git/my figures (master)
$ git filter-branch --index-filter \
> 'git ls-files -s | sed "s-\t-&my figures/-" |
> GIT_INDEX_FILE=$GIT_INDEX_FILE.new \
> git update-index --index-info &&
> mv $GIT_INDEX_FILE.new $GIT_INDEX_FILE' HEAD
Rewrite d9f3a10522f2a0e1531f45e8e7b3a518f0d714c5 (1/1)mv: when moving multiple files, last argument must be a directory
Try `mv --help' for more information.
index filter failed: git ls-files -s | sed "s-\t-&my figures/-" |
GIT_INDEX_FILE=$GIT_INDEX_FILE.new \
git update-index --index-info &&
mv $GIT_INDEX_FILE.new $GIT_INDEX_FILE
rm: cannot remove `d:/git/my figures/.git-rewrite/revs': Permission denied
rm: cannot remove directory `d:/git/my figures/.git-rewrite': Directory not empty
The, retrying with the repository renamed a myfigures, wich is working fine :
/d/git/myfigures (master)
$ git filter-branch --index-filter 'git ls-files -s | sed "s-\t-&myfigures/-" |
GIT_INDEX_FILE=$GIT_INDEX_FILE.new \
git update-index --index-info &&
mv $GIT_INDEX_FILE.new $GIT_INDEX_FILE' HEAD
Rewrite d9f3a10522f2a0e1531f45e8e7b3a518f0d714c5 (1/1)
Ref 'refs/heads/master' was rewritten
So, how tweaking this git filter-branch call to support repository name having a space in them ?