第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

在git中處理文件重命名

在git中處理文件重命名

Git
湖上湖 2019-10-14 10:17:41
我讀過在git中重命名文件時(shí),應(yīng)提交所有更改,執(zhí)行重命名,然后暫存重命名的文件。Git將從內(nèi)容中識(shí)別文件,而不是將其視為新的未跟蹤文件,并保留更改歷史記錄。但是,今晚僅此一次,我最終恢復(fù)為git mv。> $ git status# On branch master# Changes to be committed:#   (use "git reset HEAD <file>..." to unstage)##   modified:   index.html#將我在Finder中的樣式表從重命名iphone.css為mobile.css> $ git status# On branch master# Changes to be committed:#   (use "git reset HEAD <file>..." to unstage)##   modified:   index.html## Changed but not updated:#   (use "git add/rm <file>..." to update what will be committed)#   (use "git checkout -- <file>..." to discard changes in working directory)##   deleted:    css/iphone.css## Untracked files:#   (use "git add <file>..." to include in what will be committed)##   css/mobile.css所以git現(xiàn)在認(rèn)為我已經(jīng)刪除了一個(gè)CSS文件,并添加了一個(gè)新文件。不是我想要的,讓撤消重命名,讓git完成工作。> $ git reset HEAD .Unstaged changes after reset:M   css/iphone.cssM   index.html回到我開始的地方。> $ git status# On branch master# Changes to be committed:#   (use "git reset HEAD <file>..." to unstage)##   modified:   index.html#讓我們git mv改為使用。> $ git mv css/iphone.css css/mobile.css> $ git status# On branch master# Changes to be committed:#   (use "git reset HEAD <file>..." to unstage)##   renamed:    css/iphone.css -> css/mobile.css## Changed but not updated:#   (use "git add <file>..." to update what will be committed)#   (use "git checkout -- <file>..." to discard changes in working directory)##   modified:   index.html#看起來我們很好。那么,為什么在我使用Finder時(shí)git第一次沒有識(shí)別出重命名?
查看完整描述

3 回答

?
梵蒂岡之花

TA貢獻(xiàn)1900條經(jīng)驗(yàn) 獲得超5個(gè)贊

您必須將兩個(gè)修改后的文件添加到索引,然后git才能將其識(shí)別為移動(dòng)。


mv old new和之間的唯一區(qū)別git mv old new是git mv還將文件添加到索引中。


mv old new那git add -A本來也可以


請(qǐng)注意,您不能只使用它,git add .因?yàn)槟遣粫?huì)為索引添加刪除內(nèi)容。


查看完整回答
反對(duì) 回復(fù) 2019-10-14
  • 3 回答
  • 0 關(guān)注
  • 672 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)