我的目标是摆脱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