2015-02-04 34 views

回答

10

你必須從主分支。 檢出一個新的分支並刪除不需要的文件。

git checkout master 

一旦主:

git checkout -b new_branch 

rm foo.txt 
rm foo2.txt 

git add -u 
git commit -m "removed foo and foo2" 
git push origin new_branch 
+2

注意,這可能* *不會書面工作。如果您想要刪除它,您需要爲'git add'提供'-u'選項。 (http://stackoverflow.com/q/2190409) –

+0

謝謝你的權利。我會更新我的答案 – Joel

+0

爲什麼你需要-u? – user678392

相關問題