从Github完全删除已删除的文件

时间:2017-05-05 15:51:22

标签: github

我将敏感文件推送到Github,然后迅速将其删除。问题是,文件内容作为已删除的数据保留在Github中,但它仍然可以查看。

有没有办法永久删除这些数据的任何和所有Git跟踪?如果是这样,你会怎么做?

1 个答案:

答案 0 :(得分:0)

BFG repo cleaner是一个很好的工具:http://rtyley.github.io/bfg-repo-cleaner/

安装后只需使用以下命令:

using Google.Apis.YouTube.v3;

 UserCredential credential;
                using (var stream = new FileStream(keyFilePath, FileMode.Open, FileAccess.Read))
                {
                    credential = await GoogleWebAuthorizationBroker.AuthorizeAsync(
                        GoogleClientSecrets.Load(stream).Secrets,
                        scopes,
                        "user", 
                        CancellationToken.None,
                        new FileDataStore("somename"));

                var youtubeService = new YouTubeService(new 
                            BaseClientService.Initializer()
                    {
                        HttpClientInitializer = credential,
                        ApplicationName = "sosadfas"
                    });

                    return youtubeService;
                }