【问题标题】:how to remove a file from git to never exist at all [duplicate]如何从git中删除一个文件根本不存在[重复]
【发布时间】:2017-11-09 23:19:52
【问题描述】:

所以我将 ouath key file 从本地副本推送到我的 git 分支。如何覆盖 git 中的提交以删除 oauth key file

我试过了

git rm cache /storage/oauth.key 并执行了 git add、git commit、git push 到我的分支,但文件仍然存在。

我也试过了

git revert commitID 但出现错误

error: commit 5ac87ad863059396jkljkljlkjce4c64 is a merge but no -m option was given. fatal: revert failed

请指教。

【问题讨论】:

标签: git laravel-5 gitlab


【解决方案1】:

试试

git rm --cached storage/oauth.key

然后在舞台上添加您已删除的 oauth 密钥文件,提交并推送。
这必须从您的远程存储库中删除密钥文件。

【讨论】:

    猜你喜欢
    • 2012-02-23
    • 2017-02-16
    • 2021-12-29
    • 2015-01-06
    • 2012-03-06
    • 2015-08-29
    • 1970-01-01
    • 2017-01-01
    相关资源
    最近更新 更多