Is it possible to move/rename files in Git and maintain their history?

前端 未结 14 2210
梦如初夏
梦如初夏 2020-11-22 04:42

I would like to rename/move a project subtree in Git moving it from

/project/xyz

to

/components/xyz

If I

14条回答
  •  鱼传尺愫
    2020-11-22 05:29

    I have faced the issue "Renaming the folder without loosing history". To fix it, run:

    $ git mv oldfolder temp && git mv temp newfolder
    $ git commit
    $ git push
    

提交回复
热议问题