我的目標是擺脫github上所有提交中的一個文件,因此我執行了下一步:Git - 分別提交不同的提交。 (使用「git pull」將遠程分支合併到你的手中)
我已經用此命令過濾了我的分支:
git filter-branch --index-filter 'git rm --cached --ignore-unmatch [file_name]' HEAD
刪除所有提交一個單一的文件,現在運行
git status
後,問我去拉,
[email protected]:/var/www/html/laravel/app_folder$ git status
On branch master
Your branch and 'origin/master' have diverged,
and have 18 and 18 different commits each, respectively.
(use "git pull" to merge the remote branch into yours)
nothing to commit, working directory clean
但我不想拉。我害怕,如果我拉我將在我的提交再次有這個文件。
不應該我現在推它,所以這些變化對我的git hub起作用....我不知道該怎麼做。
對我來說這是最好的解釋答案,所以我接受它作爲答案 – lewis4u