git rebase - Rename directory throughout Git commit history -
i'm trying rename directory introduced 6 commits ago , in subsequent commits. these commits have not been pushed.
what have tried?
- i've tried using
git filter-branchmv old newcommand, fails on commits beforehead~6because directory doesn't exist. - i've tried
git rebase -i head~6, editing each commit, can't usemv old newbecause git's locking file, nor can rename in windows explorer. - i've tried same rebase
cp -r old new; rm -rf old; git add newcreates merge conflicts onhead~4, above.
it may worth noting commit on directory introduced first commit in branch (the branch 6 commits ahead of master) , haven't touched master since branched out.
i've read this question.
what's best way this?
git filter-branch should work fine; make mv command fail gracefully appending || true. example, rename baz/ foo/bar/baz/:
git filter-branch --force --tree-filter \ 'mkdir -p foo/bar; mv baz foo/bar/ || true' \ --tag-name-filter cat -- --all
Comments
Post a Comment