git move all content one level up, for all branches

Viewed 312

I want to move all the content in a git repository one level up, and need this to apply for every branch I have. Literally, I have:

+--repo
+----+.git
+----+folder
+--------+ A
+--------+ B

And I want simply:

+--repo
+----+.git
+----+A
+----+B

This post How can I move all git content one-level up in the folder hierarchy? has an nice answer, suggesting to do:

git mv folder/* ./ -k

Now how do I do with all the branches? I can think of:

  • do the git mv for master, then git rebase for all, on master

  • do the git mv for all branches?

Is there an advantage of one over the other? I saw also some answers based on git filter-branch --index-filter (answer here) but don;t understand how to apply it to my case.

Thanks!

1 Answers
Related