如何删除意外推送的内容 [英] How to delete something that was accidentally pushed

查看:163
本文介绍了如何删除意外推送的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的网站上进行源代码管理。有很多文件,所以我只是去git add -a

I wanted to do source control on my website. There were a lot of files so I just went git add -a

不幸的是,我意外地提交并推送了一个名为credentials.txt的文件,它具有我的ftp和db详细信息。我尝试删除该文件,然后提交,然后在浏览历史记录中的github上的repo时仍显示该文件。

Unfortunately, I accidentally committed and pushed a file called credentials.txt that had my ftp and db details. I've tried deleting the file, committing then pushing but it still shows the file when I browse my repo on github in the history.

有没有办法摆脱这是什么?

Is there anyway to get rid of this?

推荐答案

Github有一个不错的指南对这个确切的话题。它解释了如何将它从存储库中取出,以及如何处理可能已经在公众手中的数据。

Github has a nice guide on this exact topic. It explains how to get it out of the repository, as well as how to deal with the data that may already be in public hands.

这篇关于如何删除意外推送的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆