Я работаю над проектом группы, и я хочу удалить файл из всей памяти. Содержимое, имя файла, все! Я не хочу, чтобы на Git-репо оставалось никаких следов. Я пытался сделать это, используя bfg
, но я все еще могу найти файл на странице Github, используя его «», чтобы просмотреть репозиторий на этом этапе в функции истории ».Почему я все еще вижу файлы в истории GitHub после их очистки с помощью BFG?
каталог, который мерзавец репо .../electricity_profiles
и в каталоге electricity_profiles/data
там был файл Я хочу удалить (я пробовал bfg --delete-files .~lock.smart_meter_data_overlap.csv#
). Я удалил его из текущей фиксации с тех пор, но это несколько коммитов назад commit 5c50c67d1be4e869bc75fb7d3916b9fc814b8106
.
Как я могу удалить все доказательства этого файла, когда-либо существовавшие, даже в github, и поэтому, когда другие люди вытаскивают файл, они не видят его?
Я посмотрел на:
- Could not remove sensitive data
- Inspect git repo after using BFG repo-cleaner
- How do I properly remove sensitive data pushed to a Git repo?
, но не понял его еще.
Работа, выполненная до сих пор: (Кажется, работает).
git clone --mirror https://github.com/oliversheridanmethven/electricity_profiles.git
bfg --delete-files .~lock.smart_meter_data_overlap.csv# electricity_profiles.git
Консольный вывод:
Using repo : /home/user/Documents/InFoMM/case_studies/trial/electricity_profiles.git
Found 20 objects to protect
Found 2 commit-pointing refs : HEAD, refs/heads/master
Protected commits
-----------------
These are your protected commits, and so their contents will NOT be altered:
* commit 1b1eef47 (protected by 'HEAD')
Cleaning
--------
Found 22 commits
Cleaning commits: 100% (22/22)
Cleaning commits completed in 141 ms.
Updating 1 Ref
--------------
Ref Before After
---------------------------------------
refs/heads/master | 1b1eef47 | 9701a5b7
Updating references: 100% (1/1)
...Ref update completed in 26 ms.
Commit Tree-Dirt History
------------------------
Earliest Latest
| |
......D..D..m.m.mmmmmm
D = dirty commits (file tree fixed)
m = modified commits (commit message or parents changed)
. = clean commits (no changes to file tree)
Before After
-------------------------------------------
First modified commit | 5c50c67d | ff47bcdf
Last dirty commit | 9671f6ad | f6d36763
Deleted files
-------------
Filename Git id
------------------------------------------------------
.~lock.smart_meter_data_overlap.csv# | 7cf2b24f (92 B)
In total, 14 object ids were changed. Full details are logged here:
/home/user/Documents/InFoMM/case_studies/trial/electricity_profiles.git.bfg-report/2017-01-18/11-48-37
BFG run is complete! When ready, run: git reflog expire --expire=now --all && git gc --prune=now --aggressive
завершая процесс.
cd electricity_profiles.git
git push --mirror https://github.com/oliversheridanmethven/electricity_profiles.git
Глядя на репетицию Github, похоже, сработало.
Вы должны переписать историю этой отрасли и удалить файл от каждой фиксации, в которой он появляется. –
Я думаю, что это только то, что совершают до сих пор, но это, как правило, то, чего я хочу достичь. – oliversm