81668

Removed sensitive file from GitHub history, but I can still access it [duplicate]

<div class="question-status question-originals-of-duplicate">

This question already has an answer here:

    <li> How to remove a dangling commit from GitHub? <span class="question-originals-answer-count"> 2 answers </span> </li> </ul>

    I have accidentially commited file with sensitve data and wanted to get rid of it from current GitHub repo state and from the entire history. To make sure, that process is completed, I have opened a new tab in my browser, with URL pointing to some early stage of that file in repository history.

    I went through "Remove sensitive data" article in GitHub Help, I read through Darhuuk's answer, as good as many others here and still for nothing -- file is clearly removed from my local repository and its GitHub remote counterpart, but when I refresh that other tab, I can cleary see that file and its sensitve content.

    What am I missing, or what should I do next?

    Answer1:

    <strong>I had to contact GitHub Support. They ran git gc on their side to complete this procedure</strong>.

    Since I don't have any collaborators to my repository yet, and since I'm not using tags, I have eliminated steps, that in my opinion was irrelevant. Aside of them I did:

    <ol> <li>

    Emptying repository out of sensitive.file file:

    git filter-branch --force --index-filter \ "git rm --cached --ignore-unmatch sensitive.file" \ --prune-empty --tag-name-filter cat -- --all </li> <li>

    Forcing changes to GitHub:

    git push origin --force --all </li> <li>

    Purging locally cached changes:

    git for-each-ref --format='delete %(refname)' refs/original | git update-ref --stdin git reflog expire --expire=now --all git gc --prune=now </li> </ol>

    After that, git reported me, that there is nothing to commit (git status) and that my local repository is up-to-date with remote one (git pull + git push). But, I still could access that file, using URL, I had open in one of tabs, that was leading to one of its early copies in GitHub.

    Refreshing page didn't bring any change. File was clearly there.

    I contacted GitHub support and got reply withing five minutes (!). They had to run git garbage collector (git gc) on their side, to finish this process. Finally, after that, mentioned link started to show 404.

Recommend

  • Cartesian power (a special Cartesian product) — choose elements from array, in repeatable style
  • MSExchange URL encoding
  • Storing large decimal numbers in Java
  • Addresses of Delphi and C++ WinAPI functions differ when they shouldn't
  • Case insensitive search in CQ5 using querybuilder
  • PHP exec response as string?
  • React Router and Arbitrary Query Params: Page Refreshes Unintentionally on Load?
  • Can my app be notified when another application starts/stops playing audio?
  • WP7 difficulties binding data to listbox itemssource - won't refresh
  • How to calculate networkdays minus holidays between 2 dates
  • Efficient algorithm to find additions and removals from 2 collections
  • XOR with Neural Networks (Matlab)
  • Detecting # in Scheme list
  • Correct implementation of List Iterator methods
  • JQuery .html() remove line break on IE 8
  • Doctrine2 bulk import try to work with another entity
  • How can I tell a form not to dispose a particular control when it closes?
  • Low TTL with Leveled Compaction, should I reduce gc_grace_seconds to improve read performance withou
  • std::remove_copy_if_ valgrind bytes in block are possibly lost in loss record
  • Silverlight DependencyProperty.SetCurrentValue Equivalent
  • ADO and msqli connections very slow
  • With Hadoop, can I create a tasktracker on a machine that isn't running a datanode?
  • PHP buffered output depending on server setting?
  • SignalR .NET Client Invoke throws an exception
  • Regex thinks I'm nesting, but I'm not
  • What is the “return” in scheme?
  • Azure Cloud Service Web Role web pages do not load
  • DotNetZip - Calculate final zip size before calling Save(stream)
  • Warning: Can't call setState (or forceUpdate) on an unmounted component
  • How to get icons for entities from eclipse?
  • How to disable jQuery.jplayer autoplay?
  • Load html files in TinyMce
  • Free memory of cv::Mat loaded using FileStorage API
  • Why joiner is not used after Sequence generator or Update statergy
  • coudnt use logback because of log4j
  • Exception on Android 4.0 `android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode)`
  • File not found error Google Drive API
  • Are Kotlin's Float, Int etc optimised to built-in types in the JVM? [duplicate]
  • Is it possible to post an object from jquery to bottle.py?
  • costura.fody for a dll that references another dll