From: Adam Mercer Date: Mon, 09 Aug 2010 19:36:19 GMT Subject: Re: Using filter-branch to move repo contents in subdirectory Message-ID: In-Reply-To: On Thu, Jul 29, 2010 at 07:37, Adam Mercer wrote: > I'm trying to use git filter-branch to move all contents of a repo > into a subdirectory of the repo root. The git filter-branch man page > has the following example: > >       To move the whole tree into a subdirectory, or remove it from there: > >           git filter-branch --index-filter \ >                   'git ls-files -s | sed "s-\t\"*-&newsubdir/-" | >                           GIT_INDEX_FILE=$GIT_INDEX_FILE.new \ >                                   git update-index --index-info && >                    mv $GIT_INDEX_FILE.new $GIT_INDEX_FILE' HEAD I'm trying to do this with another repo now and am getting a different error message: $ git filter-branch --index-filter \ 'git ls-files -s | gsed "s-\t\"*-&sftlib/-" | GIT_INDEX_FILE=$GIT_INDEX_FILE.new \ git update-index --index-info && mv $GIT_INDEX_FILE.new $GIT_INDEX_FILE' HEAD Rewrite b3100fb24a7eb2f349801f3b87cf995dc3d14bba (1/44)mv: /Users/ram/git/eah2/.git-rewrite/t/../index.new: No such file or directory index filter failed: git ls-files -s | gsed "s-\t\"*-&sftlib/-" | GIT_INDEX_FILE=$GIT_INDEX_FILE.new git update-index --index-info && mv $GIT_INDEX_FILE.new $GIT_INDEX_FILE $ Any ideas? This is on Mac OS X 10.6.4, with git-1.7.2.1, and GNU sed 4.2.1 Cheers Adam