2015-07-10 53 views
3

變化當我做git status,我看到有本地修改一些文件(好像是縮進的變化)。做一個混帳藏匿不會刪除git的本地

當我做git stash,它不會從隊列中刪除這些文件。它阻止從遠程git獲取自動提取腳本。

$ git stash 
Saved working directory and index state WIP on develop: 05c60a5 Merge remote-tracking branch 'origin/develop' into develop 
HEAD is now at 05c60a5 Merge remote-tracking branch 'origin/develop' into develop 

$ git stash 
On branch develop 
Your branch and 'origin/develop' have diverged and have 23 and 127 different commit(s) each, respectively. 

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: config/buznames/businessname_map. 
    modified: public/css/_lib/dropdown.less 
    modified: public/css/_lib/secureBadge.less 
+1

運行'git diff',看看有什麼不同。它是縮進還是行尾? – poke

+0

它看起來像一個格式更改。內容完全刪除並再次添加。 – sonicMandelBrot

+0

'git checkout - file'似乎也不適用於這些文件。 – sonicMandelBrot

回答

0

git stash將消除任何未提交變化,但不是你的本地(unpushed)款。

我相信您當地的分行已發散,你卻在合併衝突,當你試圖去拉。在能夠繼續執行拉取請求之前,您必須先解決這些衝突。

如果你想相對於刪除所有本地提交在你的開發分支遠程分支,你可以這樣做:

$ git checkout develop 
$ git fetch origin develop 
# Reset develop branch back to origin/develop 
$ git reset --hard origin/develop 

注:這將刪除/放棄所有本地提交。您將無法恢復它們