2013-12-21 85 views
1

所以,我很愚蠢地把我的用戶名和密碼提交給一個GitHub項目,現在當我試圖從GitHub中刪除它時,我不能這樣做。從GitHub刪除敏感數據,--prune-empty命令未執行?

當我嘗試鍵入:

git filter-branch --force --index-filter \ 
'git rm --cached --ignore-unmatch php/initialize.php' \ 
--prune-empty --tag-name-filter cat -- --all 

我得到的結果是:

fatal: ambigious argument ' --prune-empty': unknown revision or path not in the working tree. 

這是什麼意思?我試圖寫我的文件目錄不同,它仍然沒有發展。

+0

移動修剪空頂線? – exussum

+0

@ user1281385這沒有幫助。然後-tag-name-filter變得無法識別。 – ReactingToAngularVues

+0

你使用的是什麼版本的Git?你可以用'git --version'來檢查。 – Chris

回答

0

解決了一點運氣。我上面提到的命令必須與它們的「刪除敏感數據」頁面上顯示的間隔和內襯相同。

所以這個:

git filter-branch --force --index-filter \ 
'git rm --cached --ignore-unmatch php/initialize.php' \ 
--prune-empty --tag-name-filter cat -- --all 

是不一樣的:

git filter-branch --force --index-filter \ 'git rm --cached --ignore-unmatch php/initialize.php' \ --prune-empty --tag-name-filter cat -- --all