-
Notifications
You must be signed in to change notification settings - Fork 5
/
github_keep_only_one_refcard_file_history.sh
executable file
·43 lines (31 loc) · 1.6 KB
/
github_keep_only_one_refcard_file_history.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# https://stackoverflow.com/questions/12191010/git-keep-only-the-latest-version-of-a-specific-file
#
# test -e tsv_edl_refcard.pdf || exit 1
# git commit --allow-empty -a -m "updating before erasing history of tsv_edl_refcard.pdf"
# git filter-repo --path tsv_edl_refcard.pdf --invert-paths
# git remote add origin https://github.com/scateu/tsv_edl.vim.git
# git config remote.origin.url [email protected]:scateu/tsv_edl.vim.git
# cp tsv_edl_refcard.pdf docs
# git add tsv_edl_refcard.pdf
# git push --force -u origin master
# https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository
# brew install git-filter-repo
mkdir _tmp_for_refcard_git_history_clean
mv tsv_edl_refcard.pdf _tmp_for_refcard_git_history_clean/
mv tsv_edl_refcard.pages _tmp_for_refcard_git_history_clean/
mv tsv_edl_flow.graffle _tmp_for_refcard_git_history_clean/
mv tsv_edl_flow.png _tmp_for_refcard_git_history_clean/
git filter-repo --force --invert-paths --path tsv_edl_refcard.pdf
git filter-repo --force --invert-paths --path tsv_edl_refcard.pages
git filter-repo --force --invert-paths --path tsv_edl_flow.graffle
git filter-repo --force --invert-paths --path tsv_edl_flow.png
mv _tmp_for_refcard_git_history_clean/* .
rmdir _tmp_for_refcard_git_history_clean
git add tsv_edl_refcard.pdf
git add tsv_edl_refcard.pages
git add tsv_edl_flow.graffle
git add tsv_edl_flow.png
git commit -m 'erase history of some large files'
git remote add origin https://github.com/scateu/tsv_edl.vim.git
git config remote.origin.url [email protected]:scateu/tsv_edl.vim.git
git push --force -u origin main