开发者

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜