Move folder in all git branches
We have a central repo with 20 branches, they all use layout like:
/.gitignore
/file1.txt
/file2.txt
Now this should be changed to
/.gitignore
/ProjectFolder/file1.txt
/ProjectFolder/file2.txt
in all branches. How would you a开发者_JS百科pproach that in git? Do the change in all branches? Merge everything to master and rename only there? Is there some magical command to batch rename in all branches?
Use scripting provided by your system and apply the commands to all branches in a for
cycle.
Something like this in bash
:
for i in $branches; do
git checkout $i
....
git commit -m "moved files"
done
精彩评论