We have a file called 'oldfile.txt'. We want to rename it to 'newfile.txt' and stage this change.
有一個(gè)名為 'oldfile.txt' 的文件,要把它改名為 'newfile.txt',并且把這個(gè)改動(dòng)記錄到暫存區(qū)。
在第11關(guān)時(shí)我們?cè)?git rm
來刪除倉庫里的文件,同樣地,如果要對(duì)倉庫里的文件改名,也不要直接用 mv
命令,而要用 git mv
命令,該命令會(huì)自動(dòng)把改動(dòng)記錄到暫存區(qū)。
第14關(guān)過關(guān)畫面如下:
http://wiki.jikexueyuan.com/project/githug-walkthrough/images/level-14-rename.png" alt="第14關(guān) rename" />